public final class HpkePrivateKeyManager extends PrivateKeyTypeManager<HpkePrivateKey,HpkePublicKey>
HpkePrivateKey keys and produces new instances of HpkeDecrypt primitives.KeyTypeManager.KeyFactory<KeyFormatProtoT extends com.google.protobuf.MessageLite,KeyProtoT extends com.google.protobuf.MessageLite>| Constructor and Description |
|---|
HpkePrivateKeyManager() |
| Modifier and Type | Method and Description |
|---|---|
String |
getKeyType()
Returns the type URL that identifies the key type of keys managed by this KeyManager.
|
HpkePublicKey |
getPublicKey(HpkePrivateKey key)
Creates a public key from the given private key.
|
int |
getVersion()
Returns the version number of this KeyManager.
|
KeyTypeManager.KeyFactory<HpkeKeyFormat,HpkePrivateKey> |
keyFactory()
Returns the
KeyTypeManager.KeyFactory for this key type. |
KeyData.KeyMaterialType |
keyMaterialType()
Returns the
KeyData.KeyMaterialType for this proto. |
HpkePrivateKey |
parseKey(com.google.protobuf.ByteString byteString)
Parses a serialized key proto.
|
static void |
registerPair(boolean newKeyAllowed)
Registers an
HpkePrivateKeyManager and an HpkePublicKeyManager with the
registry, so that HpkePrivateKey and HpkePublicKey key types can be used with Tink. |
void |
validateKey(HpkePrivateKey key)
Checks if the given
keyProto is a valid key. |
getPublicKeyClassfipsStatus, firstSupportedPrimitiveClass, getKeyClass, getPrimitive, supportedPrimitivespublic static void registerPair(boolean newKeyAllowed)
throws GeneralSecurityException
HpkePrivateKeyManager and an HpkePublicKeyManager with the
registry, so that HpkePrivateKey and HpkePublicKey key types can be used with Tink.GeneralSecurityExceptionpublic String getKeyType()
KeyTypeManagergetKeyType in class KeyTypeManager<HpkePrivateKey>public int getVersion()
KeyTypeManagergetVersion in class KeyTypeManager<HpkePrivateKey>public HpkePublicKey getPublicKey(HpkePrivateKey key)
PrivateKeyTypeManagergetPublicKey in class PrivateKeyTypeManager<HpkePrivateKey,HpkePublicKey>public KeyData.KeyMaterialType keyMaterialType()
KeyTypeManagerKeyData.KeyMaterialType for this proto.keyMaterialType in class KeyTypeManager<HpkePrivateKey>public HpkePrivateKey parseKey(com.google.protobuf.ByteString byteString) throws com.google.protobuf.InvalidProtocolBufferException
KeyTypeManagerImplement as return KeyProtoT.parseFrom(byteString);.
parseKey in class KeyTypeManager<HpkePrivateKey>com.google.protobuf.InvalidProtocolBufferExceptionpublic void validateKey(HpkePrivateKey key) throws GeneralSecurityException
KeyTypeManagerkeyProto is a valid key.validateKey in class KeyTypeManager<HpkePrivateKey>GeneralSecurityException - if the passed keyProto is not valid in any way.public KeyTypeManager.KeyFactory<HpkeKeyFormat,HpkePrivateKey> keyFactory()
KeyTypeManagerKeyTypeManager.KeyFactory for this key type.
By default, this throws an UnsupportedOperationException. Hence, if an implementation does not support creating primitives, no implementation is required.
keyFactory in class KeyTypeManager<HpkePrivateKey>