Package com.google.crypto.tink.subtle
Class Ed25519Verify
- java.lang.Object
-
- com.google.crypto.tink.subtle.Ed25519Verify
-
- All Implemented Interfaces:
PublicKeyVerify
@Immutable public final class Ed25519Verify extends java.lang.Object implements PublicKeyVerify
Ed25519 verifying.The first call to this function may take longer, because Ed25519Constants needs to be initialized.
Usage
// get the publicKey from the other party. Ed25519Verify verifier = new Ed25519Verify(publicKey); try { verifier.verify(signature, message); } catch (GeneralSecurityException e) { // all the rest of security exceptions. }- Since:
- 1.1.0
-
-
Field Summary
Fields Modifier and Type Field Description static TinkFipsUtil.AlgorithmFipsCompatibilityFIPSstatic intPUBLIC_KEY_LENstatic intSIGNATURE_LEN
-
Constructor Summary
Constructors Constructor Description Ed25519Verify(byte[] publicKey)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PublicKeyVerifycreate(Ed25519PublicKey key)voidverify(byte[] signature, byte[] data)Verifies whethersignatureis a valid signature fordata.
-
-
-
Field Detail
-
FIPS
public static final TinkFipsUtil.AlgorithmFipsCompatibility FIPS
-
PUBLIC_KEY_LEN
public static final int PUBLIC_KEY_LEN
- See Also:
- Constant Field Values
-
SIGNATURE_LEN
public static final int SIGNATURE_LEN
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static PublicKeyVerify create(Ed25519PublicKey key) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
verify
public void verify(byte[] signature, byte[] data) throws java.security.GeneralSecurityExceptionDescription copied from interface:PublicKeyVerifyVerifies whethersignatureis a valid signature fordata.- Specified by:
verifyin interfacePublicKeyVerify- Throws:
java.security.GeneralSecurityException- ifsignatureis not a valid signature fordata
-
-