Package com.google.crypto.tink.internal
Class ProtoConversions
- java.lang.Object
-
- com.google.crypto.tink.internal.ProtoConversions
-
public final class ProtoConversions extends java.lang.ObjectThis class provides conversions to Tink classes and enums which are in the public API to classes and enums generated by the Protobuf compiler.As a long term goal of Tink, we do not want to have code which the Protobuf compiler generates in the public API. Such code is more difficult to use externally to Google, for example with Maven. However, at least for some time we still will need to use these classes within Tink, hence we use such conversion code which must not be used outside of Tink as it may be removed at any time.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ProtoKeySerialization.KeyMaterialTypefromProto(com.google.crypto.tink.proto.KeyData.KeyMaterialType type)static ProtoKeySerialization.OutputPrefixTypefromProto(com.google.crypto.tink.proto.OutputPrefixType type)static BytesgetOutputPrefix(ProtoKeySerialization.OutputPrefixType type, java.lang.Integer idRequirement)Returns the output prefix using the standard technique for protobuf based keys.static com.google.crypto.tink.proto.KeyData.KeyMaterialTypetoProto(ProtoKeySerialization.KeyMaterialType type)static com.google.crypto.tink.proto.OutputPrefixTypetoProto(ProtoKeySerialization.OutputPrefixType type)
-
-
-
Method Detail
-
toProto
public static com.google.crypto.tink.proto.KeyData.KeyMaterialType toProto(ProtoKeySerialization.KeyMaterialType type) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
fromProto
public static ProtoKeySerialization.KeyMaterialType fromProto(com.google.crypto.tink.proto.KeyData.KeyMaterialType type) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
fromProto
public static ProtoKeySerialization.OutputPrefixType fromProto(com.google.crypto.tink.proto.OutputPrefixType type) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
toProto
public static com.google.crypto.tink.proto.OutputPrefixType toProto(ProtoKeySerialization.OutputPrefixType type) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
getOutputPrefix
public static Bytes getOutputPrefix(ProtoKeySerialization.OutputPrefixType type, @Nullable java.lang.Integer idRequirement) throws java.security.GeneralSecurityException
Returns the output prefix using the standard technique for protobuf based keys. Typically, this should only be needed for legacy protobuf based keys.- Throws:
java.security.GeneralSecurityException
-
-