public final class SignatureKeyTemplates extends Object
KeyTemplate for PublicKeySign and PublicKeyVerify.
One can use these templates to generate new Keyset with
KeysetHandle. To generate a new keyset that contains a single
EcdsaPrivateKey, one can do:
Config.register(SignatureConfig.TINK_1_1_0);
KeysetHandle handle = KeysetHandle.generateNew(SignatureKeyTemplates.ECDSA_P256);
PublicKeySign signer = PublicKeySignFactory.getPrimitive(handle);
| Modifier and Type | Field and Description |
|---|---|
static KeyTemplate |
ECDSA_P256
A
KeyTemplate that generates new instances of EcdsaPrivateKey with the following parameters:
Hash function: SHA256
Curve: NIST P-256
Signature encoding: DER (this is the encoding that Java uses). |
static KeyTemplate |
ECDSA_P256_IEEE_P1363
A
KeyTemplate that generates new instances of EcdsaPrivateKey with the following parameters:
Hash function: SHA256
Curve: NIST P-256
Signature encoding: IEEE_P1363 (this is the encoding that JWS and WebCrypto use). |
static KeyTemplate |
ECDSA_P384
A
KeyTemplate that generates new instances of EcdsaPrivateKey with the following parameters:
Hash function: SHA512
Curve: NIST P-384
Signature encoding: DER (this is the encoding that Java uses). |
static KeyTemplate |
ECDSA_P384_IEEE_P1363
A
KeyTemplate that generates new instances of EcdsaPrivateKey with the following parameters:
Hash function: SHA512
Curve: NIST P-384
Signature encoding: IEEE_P1363 (this is the encoding that JWS and WebCrypto use). |
static KeyTemplate |
ECDSA_P521
A
KeyTemplate that generates new instances of EcdsaPrivateKey with the following parameters:
Hash function: SHA512
Curve: NIST P-521
Signature encoding: DER (this is the encoding that Java uses). |
static KeyTemplate |
ECDSA_P521_IEEE_P1363
A
KeyTemplate that generates new instances of EcdsaPrivateKey with the following parameters:
Hash function: SHA512
Curve: NIST P-521
Signature encoding: IEEE_P1363 (this is the encoding that JWS and WebCrypto use). |
static KeyTemplate |
ED25519
A
KeyTemplate that generates new instances of Ed25519PrivateKey. |
| Constructor and Description |
|---|
SignatureKeyTemplates() |
| Modifier and Type | Method and Description |
|---|---|
static KeyTemplate |
createEcdsaKeyTemplate(HashType hashType,
EllipticCurveType curve,
EcdsaSignatureEncoding encoding) |
public static final KeyTemplate ECDSA_P256
KeyTemplate that generates new instances of EcdsaPrivateKey with the following parameters:
public static final KeyTemplate ECDSA_P384
KeyTemplate that generates new instances of EcdsaPrivateKey with the following parameters:
public static final KeyTemplate ECDSA_P521
KeyTemplate that generates new instances of EcdsaPrivateKey with the following parameters:
public static final KeyTemplate ECDSA_P256_IEEE_P1363
KeyTemplate that generates new instances of EcdsaPrivateKey with the following parameters:
public static final KeyTemplate ECDSA_P384_IEEE_P1363
KeyTemplate that generates new instances of EcdsaPrivateKey with the following parameters:
public static final KeyTemplate ECDSA_P521_IEEE_P1363
KeyTemplate that generates new instances of EcdsaPrivateKey with the following parameters:
public static final KeyTemplate ED25519
KeyTemplate that generates new instances of Ed25519PrivateKey.public static KeyTemplate createEcdsaKeyTemplate(HashType hashType, EllipticCurveType curve, EcdsaSignatureEncoding encoding)
KeyTemplate containing a HmacKeyFormat with some specified
parameters.