public final class EcdsaSignKeyManager extends PrivateKeyTypeManager<com.google.crypto.tink.proto.EcdsaPrivateKey,com.google.crypto.tink.proto.EcdsaPublicKey>
EcdsaPrivateKey keys and produces new instances of EcdsaSignJce.KeyTypeManager.KeyFactory<KeyFormatProtoT extends com.google.protobuf.MessageLite,KeyT>, KeyTypeManager.PrimitiveFactory<PrimitiveT,KeyT>| Modifier and Type | Method and Description |
|---|---|
static KeyTemplate |
createKeyTemplate(com.google.crypto.tink.proto.HashType hashType,
com.google.crypto.tink.proto.EllipticCurveType curve,
com.google.crypto.tink.proto.EcdsaSignatureEncoding encoding,
KeyTemplate.OutputPrefixType prefixType) |
static KeyTemplate |
ecdsaP256Template() |
String |
getKeyType()
Returns the type URL that identifies the key type of keys managed by this KeyManager.
|
com.google.crypto.tink.proto.EcdsaPublicKey |
getPublicKey(com.google.crypto.tink.proto.EcdsaPrivateKey key)
Creates a public key from the given private key.
|
int |
getVersion()
Returns the version number of this KeyManager.
|
KeyTypeManager.KeyFactory<com.google.crypto.tink.proto.EcdsaKeyFormat,com.google.crypto.tink.proto.EcdsaPrivateKey> |
keyFactory()
Returns the
KeyTypeManager.KeyFactory for this key type. |
com.google.crypto.tink.proto.KeyData.KeyMaterialType |
keyMaterialType()
Returns the
KeyData.KeyMaterialType for this proto. |
com.google.crypto.tink.proto.EcdsaPrivateKey |
parseKey(com.google.protobuf.ByteString byteString)
Parses a serialized key proto.
|
static KeyTemplate |
rawEcdsaP256Template() |
static void |
registerPair(boolean newKeyAllowed)
Registers the
EcdsaSignKeyManager and the EcdsaVerifyKeyManager with the
registry, so that the the Ecdsa-Keys can be used with Tink. |
void |
validateKey(com.google.crypto.tink.proto.EcdsaPrivateKey privKey)
Checks if the given
keyProto is a valid key. |
getPublicKeyClassgetKeyClass, getPrimitive, supportedPrimitivespublic String getKeyType()
KeyTypeManagergetKeyType in class KeyTypeManager<com.google.crypto.tink.proto.EcdsaPrivateKey>public int getVersion()
KeyTypeManagergetVersion in class KeyTypeManager<com.google.crypto.tink.proto.EcdsaPrivateKey>public com.google.crypto.tink.proto.EcdsaPublicKey getPublicKey(com.google.crypto.tink.proto.EcdsaPrivateKey key)
throws GeneralSecurityException
PrivateKeyTypeManagergetPublicKey in class PrivateKeyTypeManager<com.google.crypto.tink.proto.EcdsaPrivateKey,com.google.crypto.tink.proto.EcdsaPublicKey>GeneralSecurityExceptionpublic com.google.crypto.tink.proto.KeyData.KeyMaterialType keyMaterialType()
KeyTypeManagerKeyData.KeyMaterialType for this proto.keyMaterialType in class KeyTypeManager<com.google.crypto.tink.proto.EcdsaPrivateKey>public com.google.crypto.tink.proto.EcdsaPrivateKey parseKey(com.google.protobuf.ByteString byteString)
throws com.google.protobuf.InvalidProtocolBufferException
KeyTypeManagerImplement as return KeyProtoT.parseFrom(byteString);.
parseKey in class KeyTypeManager<com.google.crypto.tink.proto.EcdsaPrivateKey>com.google.protobuf.InvalidProtocolBufferExceptionpublic void validateKey(com.google.crypto.tink.proto.EcdsaPrivateKey privKey)
throws GeneralSecurityException
KeyTypeManagerkeyProto is a valid key.validateKey in class KeyTypeManager<com.google.crypto.tink.proto.EcdsaPrivateKey>GeneralSecurityException - if the passed keyProto is not valid in any way.public KeyTypeManager.KeyFactory<com.google.crypto.tink.proto.EcdsaKeyFormat,com.google.crypto.tink.proto.EcdsaPrivateKey> 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<com.google.crypto.tink.proto.EcdsaPrivateKey>public static void registerPair(boolean newKeyAllowed)
throws GeneralSecurityException
EcdsaSignKeyManager and the EcdsaVerifyKeyManager with the
registry, so that the the Ecdsa-Keys can be used with Tink.GeneralSecurityExceptionpublic static final KeyTemplate ecdsaP256Template()
KeyTemplate that generates new instances of ECDSA keys with the following
parameters:
KeyTemplate.OutputPrefixType#TINK.
public static final KeyTemplate rawEcdsaP256Template()
KeyTemplate that generates new instances of ECDSA keys with the following
parameters:
public static KeyTemplate createKeyTemplate(com.google.crypto.tink.proto.HashType hashType, com.google.crypto.tink.proto.EllipticCurveType curve, com.google.crypto.tink.proto.EcdsaSignatureEncoding encoding, KeyTemplate.OutputPrefixType prefixType)
KeyTemplate containing a EcdsaKeyFormat with some specified
parameters.