public interface KeyManager<P>
A key type is identified by the global name of the protocol buffer that holds the
corresponding key material, and is given by typeUrl-field of KeyData-protocol
buffer.
The template parameter P denotes the primitive corresponding to the keys handled by
this manager.
| Modifier and Type | Method and Description |
|---|---|
default boolean |
doesSupport(String typeUrl)
Deprecated.
Use
getKeyType() instead. |
String |
getKeyType()
Returns the type URL that identifies the key type of keys managed by this KeyManager.
|
P |
getPrimitive(com.google.protobuf.ByteString serializedKey)
Constructs an instance of P for the key given in
serializedKey, which must be a
serialized key protocol buffer handled by this manager. |
default P |
getPrimitive(com.google.protobuf.MessageLite key)
Deprecated.
Use
getPrimitive(serializedKey) instead. |
Class<P> |
getPrimitiveClass()
Returns the primitive class object of the P.
|
default int |
getVersion()
Deprecated.
Do not use it.
|
default com.google.protobuf.MessageLite |
newKey(com.google.protobuf.ByteString serializedKeyFormat)
Deprecated.
Use
newKeyData(serializedKeyFormat) instead. |
default com.google.protobuf.MessageLite |
newKey(com.google.protobuf.MessageLite keyFormat)
Deprecated.
Use
newKeyData(serializedKeyFormat) instead. |
KeyData |
newKeyData(com.google.protobuf.ByteString serializedKeyFormat)
Generates a new
KeyData according to specification in serializedKeyFormat. |
P getPrimitive(com.google.protobuf.ByteString serializedKey) throws GeneralSecurityException
serializedKey, which must be a
serialized key protocol buffer handled by this manager.
For primitives of type Mac, Aead, PublicKeySign, PublicKeyVerify, DeterministicAead, HybridEncrypt, and HybridDecrypt
this should be a primitive which ignores the output prefix and assumes "RAW".
GeneralSecurityException - if the key given in serializedKey is corrupted or not
supported@Deprecated default P getPrimitive(com.google.protobuf.MessageLite key) throws GeneralSecurityException
getPrimitive(serializedKey) instead.key.
For primitives of type Mac, Aead, PublicKeySign, PublicKeyVerify, DeterministicAead, HybridEncrypt, and HybridDecrypt
this should be a primitive which ignores the output prefix and assumes "RAW".
This method is not used by Tink. It does not need to be implemented.
GeneralSecurityException - if the key given in key is corrupted or not supported@Deprecated default com.google.protobuf.MessageLite newKey(com.google.protobuf.ByteString serializedKeyFormat) throws GeneralSecurityException
newKeyData(serializedKeyFormat) instead.serializedKeyFormat, which must be a
serialized key format protocol buffer handled by this manager.
This method is not used by Tink anymore. It does not need to be implemented.
GeneralSecurityException - if the specified format is wrong or not supported@Deprecated default com.google.protobuf.MessageLite newKey(com.google.protobuf.MessageLite keyFormat) throws GeneralSecurityException
newKeyData(serializedKeyFormat) instead.keyFormat.
This method is only used by Registry.newKey which is deprecated and not used by Tink
anymore. This method does not need to be implemented.
GeneralSecurityException - if the specified format is wrong or not supported@Deprecated default boolean doesSupport(String typeUrl)
getKeyType() instead.typeUrl.
This method is not used by Tink anymore. It does not need to be implemented.
String getKeyType()
@Deprecated default int getVersion()
This method is not used by Tink anymore. It does not need to be implemented.
Class<P> getPrimitiveClass()
return P.class;
when implementing a key manager for primitive {$code P}.P.classKeyData newKeyData(com.google.protobuf.ByteString serializedKeyFormat) throws GeneralSecurityException
KeyData according to specification in serializedKeyFormat.GeneralSecurityException - if the specified format is wrong or not supported