Package com.google.crypto.tink.signature
Class SignaturePrivateKey
- java.lang.Object
-
- com.google.crypto.tink.Key
-
- com.google.crypto.tink.signature.SignaturePrivateKey
-
- All Implemented Interfaces:
PrivateKey
- Direct Known Subclasses:
EcdsaPrivateKey,Ed25519PrivateKey,RsaSsaPkcs1PrivateKey,RsaSsaPssPrivateKey
@Immutable public abstract class SignaturePrivateKey extends Key implements PrivateKey
ASignaturePrivateKeyrepresents a digital signature primitive, which consists of a sign and a verify function.The verify function is only available indirectly, with
getPublicKey().
-
-
Constructor Summary
Constructors Constructor Description SignaturePrivateKey()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.IntegergetIdRequirementOrNull()Returns null if this key has no id requirement, otherwise the required id.BytesgetOutputPrefix()Returns aBytesinstance which is prefixed to every signature.SignatureParametersgetParameters()Returns the parameters of this key.abstract SignaturePublicKeygetPublicKey()Returns theSignaturePublicKey, which contains the verify function of the digital signature primitive.
-
-
-
Method Detail
-
getPublicKey
public abstract SignaturePublicKey getPublicKey()
Returns theSignaturePublicKey, which contains the verify function of the digital signature primitive.- Specified by:
getPublicKeyin interfacePrivateKey
-
getOutputPrefix
public final Bytes getOutputPrefix()
Returns aBytesinstance which is prefixed to every signature.Returns the same as
getPublicKey().getOutputPrefix().
-
getIdRequirementOrNull
@Nullable public java.lang.Integer getIdRequirementOrNull()
Description copied from class:KeyReturns null if this key has no id requirement, otherwise the required id.Some keys, when they are in a keyset, are required to have a certain ID to work properly. This comes from the fact that Tink in some cases prefixes ciphertexts or signatures with the string
0x01<id>, where the ID is encoded in big endian (see the documentation of the key type for details), in which case the key requires a certain ID.- Specified by:
getIdRequirementOrNullin classKey
-
getParameters
public SignatureParameters getParameters()
Returns the parameters of this key.Returns the same as
getPublicKey().getParameters().- Specified by:
getParametersin classKey
-
-