public final class EdDSASigningHandler extends Object implements SigningHandler
Modifier and Type | Method and Description |
---|---|
static EdDSASigningHandler |
forSigning(byte[] privateKey)
Initialises a signing handler for signing.
|
static EdDSASigningHandler |
forVerification(byte[] publicKey)
Initialises a signing handler for verification.
|
byte[] |
sign(JwsAlgorithm algorithm,
byte[] data)
Signs the given raw data bytes using the Java Cryptographic algorithm defined by the JwsAlgorithm.
|
boolean |
verify(JwsAlgorithm algorithm,
byte[] data,
byte[] signature)
Verifies that the given signature is valid for the given data.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
sign
public static EdDSASigningHandler forSigning(byte[] privateKey)
privateKey
- the private key bytes.public static EdDSASigningHandler forVerification(byte[] publicKey)
publicKey
- the public key bytes.public byte[] sign(JwsAlgorithm algorithm, byte[] data)
SigningHandler
sign
in interface SigningHandler
algorithm
- the JWS signature algorithm to use.data
- the raw data to sign.public boolean verify(JwsAlgorithm algorithm, byte[] data, byte[] signature)
SigningHandler
Uses the Java Cryptographic algorithm defined by the JwsAlgorithm and private key to create a new signature of the data to compare against the given signature to see if they are identical.
verify
in interface SigningHandler
algorithm
- The JwsAlgorithm defining the JavaCryptographic algorithm.data
- The data that was signed.signature
- The signature of the data.true
if the signature is a valid signature of the data.Copyright 2010-2022 ForgeRock AS.