Package com.google.crypto.tink.signature
Class Ed25519PrivateKey
- java.lang.Object
-
- com.google.crypto.tink.Key
-
- com.google.crypto.tink.signature.SignaturePrivateKey
-
- com.google.crypto.tink.signature.Ed25519PrivateKey
-
- All Implemented Interfaces:
PrivateKey
@Immutable public final class Ed25519PrivateKey extends SignaturePrivateKey
The key for computing Ed25519 signatures.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Ed25519PrivateKeycreate(Ed25519PublicKey publicKey, SecretBytes privateKeyBytes)booleanequalsKey(Key o)Returns true if the key is guaranteed to be equal toother.Ed25519ParametersgetParameters()Returns the parameters of this key.SecretBytesgetPrivateKeyBytes()Ed25519PublicKeygetPublicKey()Returns theSignaturePublicKey, which contains the verify function of the digital signature primitive.-
Methods inherited from class com.google.crypto.tink.signature.SignaturePrivateKey
getIdRequirementOrNull, getOutputPrefix
-
-
-
-
Method Detail
-
create
public static Ed25519PrivateKey create(Ed25519PublicKey publicKey, SecretBytes privateKeyBytes) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
getParameters
public Ed25519Parameters getParameters()
Description copied from class:SignaturePrivateKeyReturns the parameters of this key.Returns the same as
getPublicKey().getParameters().- Overrides:
getParametersin classSignaturePrivateKey
-
getPublicKey
public Ed25519PublicKey getPublicKey()
Description copied from class:SignaturePrivateKeyReturns theSignaturePublicKey, which contains the verify function of the digital signature primitive.- Specified by:
getPublicKeyin interfacePrivateKey- Specified by:
getPublicKeyin classSignaturePrivateKey
-
getPrivateKeyBytes
public SecretBytes getPrivateKeyBytes()
-
equalsKey
public boolean equalsKey(Key o)
Description copied from class:KeyReturns true if the key is guaranteed to be equal toother.Implementations are required to do this in constant time.
Note: this is allowed to return false even if two keys are guaranteed to represent the same function, but are represented differently. For example, a key is allowed to internally store the number of zero-bytes used as padding when a large number is represented as a byte array, and use this in the comparison.
Note: Tink
Keyobjects should typically not overridehashCode(because it could risk leaking key material). Hence, they typically also should not overrideequals.
-
-