Package com.google.crypto.tink.signature
Class SignatureKeyTemplates
- java.lang.Object
-
- com.google.crypto.tink.signature.SignatureKeyTemplates
-
public final class SignatureKeyTemplates extends java.lang.ObjectPre-generatedKeyTemplateforPublicKeySignandPublicKeyVerify.We recommend to avoid this class in order to keep dependencies small.
- Using this class adds a dependency on protobuf. We hope that eventually it is possible to use Tink without a dependency on protobuf.
- Using this class adds a dependency on classes for all involved key types.
Instead, we recommend to use
KeysetHandle.generateEntryFromParametersNameorKeysetHandle.generateEntryFromParameters.One can use these templates to generate new
KeysetwithKeysetHandle. To generate a new keyset that contains a singleEcdsaPrivateKey, one can do:SignatureConfig.register(); KeysetHandle handle = KeysetHandle.generateNew(SignatureKeyTemplates.ECDSA_P256); PublicKeySign signer = handle.getPrimitive(RegistryConfiguration.get(), PublicKeySign.class); PublicKeyVerify verifier = handle.getPublicKeyset().getPrimitive(RegistryConfiguration.get(), PublicKeyVerify.class);- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.crypto.tink.proto.KeyTemplateECDSA_P256AKeyTemplatethat generates new instances ofEcdsaPrivateKeywith the following parameters: Hash function: SHA256 Curve: NIST P-256 Signature encoding: DER (this is the encoding that Java uses).static com.google.crypto.tink.proto.KeyTemplateECDSA_P256_IEEE_P1363AKeyTemplatethat generates new instances ofEcdsaPrivateKeywith the following parameters: Hash function: SHA256 Curve: NIST P-256 Signature encoding: IEEE_P1363 (this is the encoding that JWS and WebCrypto use).static com.google.crypto.tink.proto.KeyTemplateECDSA_P256_IEEE_P1363_WITHOUT_PREFIXAKeyTemplatethat generates new instances ofEcdsaPrivateKeywith the following parameters: Hash function: SHA256 Curve: NIST P-256 Signature encoding: DER (this is the encoding that Java uses).static com.google.crypto.tink.proto.KeyTemplateECDSA_P384AKeyTemplatethat generates new instances ofEcdsaPrivateKeywith the following parameters: Hash function: SHA512 Curve: NIST P-384 Signature encoding: DER (this is the encoding that Java uses).static com.google.crypto.tink.proto.KeyTemplateECDSA_P384_IEEE_P1363AKeyTemplatethat generates new instances ofEcdsaPrivateKeywith the following parameters: Hash function: SHA512 Curve: NIST P-384 Signature encoding: IEEE_P1363 (this is the encoding that JWS and WebCrypto use).static com.google.crypto.tink.proto.KeyTemplateECDSA_P521AKeyTemplatethat generates new instances ofEcdsaPrivateKeywith the following parameters: Hash function: SHA512 Curve: NIST P-521 Signature encoding: DER (this is the encoding that Java uses).static com.google.crypto.tink.proto.KeyTemplateECDSA_P521_IEEE_P1363AKeyTemplatethat generates new instances ofEcdsaPrivateKeywith the following parameters: Hash function: SHA512 Curve: NIST P-521 Signature encoding: IEEE_P1363 (this is the encoding that JWS and WebCrypto use).static com.google.crypto.tink.proto.KeyTemplateED25519AKeyTemplatethat generates new instances ofEd25519PrivateKey.static com.google.crypto.tink.proto.KeyTemplateED25519WithRawOutputAKeyTemplatethat generates new instances ofcom.google.crypto.tink.proto.ED25519PrivateKey.static com.google.crypto.tink.proto.KeyTemplateRSA_SSA_PKCS1_3072_SHA256_F4AKeyTemplatethat generates new instances ofRsaSsaPkcs1PrivateKeywith the following parameters: Hash function: SHA256.static com.google.crypto.tink.proto.KeyTemplateRSA_SSA_PKCS1_3072_SHA256_F4_WITHOUT_PREFIXAKeyTemplatethat generates new instances ofRsaSsaPkcs1PrivateKeywith the following parameters: Hash function: SHA256.static com.google.crypto.tink.proto.KeyTemplateRSA_SSA_PKCS1_4096_SHA512_F4AKeyTemplatethat generates new instances ofRsaSsaPkcs1PrivateKeywith the following parameters: Hash function: SHA512.static com.google.crypto.tink.proto.KeyTemplateRSA_SSA_PSS_3072_SHA256_SHA256_32_F4AKeyTemplatethat generates new instances ofRsaSsaPssPrivateKeywith the following parameters: Signature hash: SHA256.static com.google.crypto.tink.proto.KeyTemplateRSA_SSA_PSS_4096_SHA512_SHA512_64_F4AKeyTemplatethat generates new instances ofRsaSsaPssPrivateKeywith the following parameters: Signature hash: SHA512.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static com.google.crypto.tink.proto.KeyTemplatecreateEcdsaKeyTemplate(com.google.crypto.tink.proto.HashType hashType, com.google.crypto.tink.proto.EllipticCurveType curve, com.google.crypto.tink.proto.EcdsaSignatureEncoding encoding, com.google.crypto.tink.proto.OutputPrefixType prefixType)Deprecated.Use a correspondingEcdsaParametersobject instead.static com.google.crypto.tink.proto.KeyTemplatecreateRsaSsaPkcs1KeyTemplate(com.google.crypto.tink.proto.HashType hashType, int modulusSize, java.math.BigInteger publicExponent, com.google.crypto.tink.proto.OutputPrefixType prefixType)Deprecated.Use a correspondingRsaSsaPkcs1Parametersobject insteadstatic com.google.crypto.tink.proto.KeyTemplatecreateRsaSsaPssKeyTemplate(com.google.crypto.tink.proto.HashType sigHash, com.google.crypto.tink.proto.HashType mgf1Hash, int saltLength, int modulusSize, java.math.BigInteger publicExponent)Deprecated.Use a correspondingRsaSsaPssParametersobject instead.
-
-
-
Field Detail
-
ECDSA_P256
public static final com.google.crypto.tink.proto.KeyTemplate ECDSA_P256
AKeyTemplatethat generates new instances ofEcdsaPrivateKeywith the following parameters:- Hash function: SHA256
- Curve: NIST P-256
- Signature encoding: DER (this is the encoding that Java uses).
- Prefix type:
OutputPrefixType.TINK
-
ECDSA_P384
public static final com.google.crypto.tink.proto.KeyTemplate ECDSA_P384
AKeyTemplatethat generates new instances ofEcdsaPrivateKeywith the following parameters:- Hash function: SHA512
- Curve: NIST P-384
- Signature encoding: DER (this is the encoding that Java uses).
- Prefix type:
OutputPrefixType.TINK
-
ECDSA_P521
public static final com.google.crypto.tink.proto.KeyTemplate ECDSA_P521
AKeyTemplatethat generates new instances ofEcdsaPrivateKeywith the following parameters:- Hash function: SHA512
- Curve: NIST P-521
- Signature encoding: DER (this is the encoding that Java uses).
- Prefix type:
OutputPrefixType.TINK
-
ECDSA_P256_IEEE_P1363
public static final com.google.crypto.tink.proto.KeyTemplate ECDSA_P256_IEEE_P1363
AKeyTemplatethat generates new instances ofEcdsaPrivateKeywith the following parameters:- Hash function: SHA256
- Curve: NIST P-256
- Signature encoding: IEEE_P1363 (this is the encoding that JWS and WebCrypto use).
- Prefix type:
OutputPrefixType.TINK
-
ECDSA_P384_IEEE_P1363
public static final com.google.crypto.tink.proto.KeyTemplate ECDSA_P384_IEEE_P1363
AKeyTemplatethat generates new instances ofEcdsaPrivateKeywith the following parameters:- Hash function: SHA512
- Curve: NIST P-384
- Signature encoding: IEEE_P1363 (this is the encoding that JWS and WebCrypto use).
- Prefix type:
OutputPrefixType.TINK
-
ECDSA_P256_IEEE_P1363_WITHOUT_PREFIX
public static final com.google.crypto.tink.proto.KeyTemplate ECDSA_P256_IEEE_P1363_WITHOUT_PREFIX
AKeyTemplatethat generates new instances ofEcdsaPrivateKeywith the following parameters:- Hash function: SHA256
- Curve: NIST P-256
- Signature encoding: DER (this is the encoding that Java uses).
- Prefix type: None
-
ECDSA_P521_IEEE_P1363
public static final com.google.crypto.tink.proto.KeyTemplate ECDSA_P521_IEEE_P1363
AKeyTemplatethat generates new instances ofEcdsaPrivateKeywith the following parameters:- Hash function: SHA512
- Curve: NIST P-521
- Signature encoding: IEEE_P1363 (this is the encoding that JWS and WebCrypto use).
- Prefix type:
OutputPrefixType.TINK
-
ED25519
public static final com.google.crypto.tink.proto.KeyTemplate ED25519
AKeyTemplatethat generates new instances ofEd25519PrivateKey.- Since:
- 1.1.0
-
ED25519WithRawOutput
public static final com.google.crypto.tink.proto.KeyTemplate ED25519WithRawOutput
AKeyTemplatethat generates new instances ofcom.google.crypto.tink.proto.ED25519PrivateKey.The difference between
ED25519WithRawOutputandED25519is the format of signatures generated.ED25519WithRawOutputgenerates signatures ofOutputPrefixType.RAWformat, which is 64 bytes long.- Since:
- 1.3.0
-
RSA_SSA_PKCS1_3072_SHA256_F4
public static final com.google.crypto.tink.proto.KeyTemplate RSA_SSA_PKCS1_3072_SHA256_F4
AKeyTemplatethat generates new instances ofRsaSsaPkcs1PrivateKeywith the following parameters:- Hash function: SHA256.
- Modulus size: 3072 bit.
- Public exponent: 65537 (aka F4).
- Prefix type:
OutputPrefixType.TINK
-
RSA_SSA_PKCS1_3072_SHA256_F4_WITHOUT_PREFIX
public static final com.google.crypto.tink.proto.KeyTemplate RSA_SSA_PKCS1_3072_SHA256_F4_WITHOUT_PREFIX
AKeyTemplatethat generates new instances ofRsaSsaPkcs1PrivateKeywith the following parameters:- Hash function: SHA256.
- Modulus size: 3072 bit.
- Public exponent: 65537 (aka F4).
- Prefix type: None
-
RSA_SSA_PKCS1_4096_SHA512_F4
public static final com.google.crypto.tink.proto.KeyTemplate RSA_SSA_PKCS1_4096_SHA512_F4
AKeyTemplatethat generates new instances ofRsaSsaPkcs1PrivateKeywith the following parameters:- Hash function: SHA512.
- Modulus size: 4096 bit.
- Public exponent: 65537 (aka F4).
- Prefix type:
OutputPrefixType.TINK
-
RSA_SSA_PSS_3072_SHA256_SHA256_32_F4
public static final com.google.crypto.tink.proto.KeyTemplate RSA_SSA_PSS_3072_SHA256_SHA256_32_F4
AKeyTemplatethat generates new instances ofRsaSsaPssPrivateKeywith the following parameters:- Signature hash: SHA256.
- MGF1 hash: SHA256.
- Salt length: 32 (i.e., SHA256's output length).
- Modulus size: 3072 bit.
- Public exponent: 65537 (aka F4).
-
RSA_SSA_PSS_4096_SHA512_SHA512_64_F4
public static final com.google.crypto.tink.proto.KeyTemplate RSA_SSA_PSS_4096_SHA512_SHA512_64_F4
AKeyTemplatethat generates new instances ofRsaSsaPssPrivateKeywith the following parameters:- Signature hash: SHA512.
- MGF1 hash: SHA512.
- Salt length: 64 (i.e., SHA512's output length).
- Modulus size: 4096 bit.
- Public exponent: 65537 (aka F4).
-
-
Method Detail
-
createEcdsaKeyTemplate
@Deprecated public static com.google.crypto.tink.proto.KeyTemplate createEcdsaKeyTemplate(com.google.crypto.tink.proto.HashType hashType, com.google.crypto.tink.proto.EllipticCurveType curve, com.google.crypto.tink.proto.EcdsaSignatureEncoding encoding, com.google.crypto.tink.proto.OutputPrefixType prefixType)Deprecated.Use a correspondingEcdsaParametersobject instead.- Returns:
- a
KeyTemplatecontaining aEcdsaKeyFormatwith some specified parameters.
-
createRsaSsaPkcs1KeyTemplate
@Deprecated public static com.google.crypto.tink.proto.KeyTemplate createRsaSsaPkcs1KeyTemplate(com.google.crypto.tink.proto.HashType hashType, int modulusSize, java.math.BigInteger publicExponent, com.google.crypto.tink.proto.OutputPrefixType prefixType)Deprecated.Use a correspondingRsaSsaPkcs1Parametersobject instead- Returns:
- a
KeyTemplatecontaining aRsaSsaPkcs1KeyFormatwith some specified parameters.
-
createRsaSsaPssKeyTemplate
@Deprecated public static com.google.crypto.tink.proto.KeyTemplate createRsaSsaPssKeyTemplate(com.google.crypto.tink.proto.HashType sigHash, com.google.crypto.tink.proto.HashType mgf1Hash, int saltLength, int modulusSize, java.math.BigInteger publicExponent)Deprecated.Use a correspondingRsaSsaPssParametersobject instead.- Returns:
- a
KeyTemplatecontaining aRsaSsaPssKeyFormatwith some specified parameters.
-
-