public class ChaCha20Poly1305KeyManager extends KeyTypeManager<ChaCha20Poly1305Key>
KeyManager generates new ChaCha20Poly1305 keys and produces new
instances of ChaCha20Poly1305.KeyTypeManager.KeyFactory<KeyFormatProtoT extends com.google.protobuf.MessageLite,KeyProtoT extends com.google.protobuf.MessageLite>| Modifier and Type | Method and Description |
|---|---|
static KeyTemplate |
chaCha20Poly1305Template() |
String |
getKeyType()
Returns the type URL that identifies the key type of keys managed by this KeyManager.
|
int |
getVersion()
Returns the version number of this KeyManager.
|
KeyTypeManager.KeyFactory<ChaCha20Poly1305KeyFormat,ChaCha20Poly1305Key> |
keyFactory()
Returns the
KeyTypeManager.KeyFactory for this key type. |
KeyData.KeyMaterialType |
keyMaterialType()
Returns the
KeyData.KeyMaterialType for this proto. |
ChaCha20Poly1305Key |
parseKey(com.google.protobuf.ByteString byteString)
Parses a serialized key proto.
|
static KeyTemplate |
rawChaCha20Poly1305Template() |
static void |
register(boolean newKeyAllowed) |
void |
validateKey(ChaCha20Poly1305Key key)
Checks if the given
keyProto is a valid key. |
fipsStatus, firstSupportedPrimitiveClass, getKeyClass, getPrimitive, supportedPrimitivespublic String getKeyType()
KeyTypeManagergetKeyType in class KeyTypeManager<ChaCha20Poly1305Key>public int getVersion()
KeyTypeManagergetVersion in class KeyTypeManager<ChaCha20Poly1305Key>public KeyData.KeyMaterialType keyMaterialType()
KeyTypeManagerKeyData.KeyMaterialType for this proto.keyMaterialType in class KeyTypeManager<ChaCha20Poly1305Key>public void validateKey(ChaCha20Poly1305Key key) throws GeneralSecurityException
KeyTypeManagerkeyProto is a valid key.validateKey in class KeyTypeManager<ChaCha20Poly1305Key>GeneralSecurityException - if the passed keyProto is not valid in any way.public ChaCha20Poly1305Key parseKey(com.google.protobuf.ByteString byteString) throws com.google.protobuf.InvalidProtocolBufferException
KeyTypeManagerImplement as return KeyProtoT.parseFrom(byteString);.
parseKey in class KeyTypeManager<ChaCha20Poly1305Key>com.google.protobuf.InvalidProtocolBufferExceptionpublic KeyTypeManager.KeyFactory<ChaCha20Poly1305KeyFormat,ChaCha20Poly1305Key> 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<ChaCha20Poly1305Key>public static void register(boolean newKeyAllowed)
throws GeneralSecurityException
GeneralSecurityExceptionpublic static final KeyTemplate chaCha20Poly1305Template()
KeyTemplate that generates new instances of ChaCha20Poly1305 keys.public static final KeyTemplate rawChaCha20Poly1305Template()
KeyTemplate that generates new instances of ChaCha20Poly1305 keys. Keys
generated from this template create ciphertexts compatible with libsodium and other
libraries.