Package io.jans.lock.trace.crypto.bc
Class Ed25519Verifier
java.lang.Object
io.jans.lock.trace.crypto.bc.Ed25519Verifier
Verifies Ed25519 (RFC 8032, PureEdDSA, no pre-hash, no context) signatures with the JCA
Signature of the installed BouncyCastle provider. Constant-time behaviour is the
provider's responsibility; this class never compares signature bytes itself beyond the length
check.
Stateless and thread-safe: a fresh Signature instance is created per call.
- Author:
- Yuriy Movchan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intLength of an Ed25519 signature (RFC 8032 §5.1.6). -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
SIGNATURE_LENGTH
public static final int SIGNATURE_LENGTHLength of an Ed25519 signature (RFC 8032 §5.1.6).- See Also:
-
-
Constructor Details
-
Ed25519Verifier
public Ed25519Verifier()
-
-
Method Details
-
verify
- Parameters:
key- the producer's public key, fromEd25519PublicKeysmessage- the exact bytes that were signed (for TRACE: UTF-8 of the JCS form of the assertion withoutsignature)signature- the raw 64-byte signature- Returns:
trueonly if the provider accepts the signature;falsefor a null or wrongly sized signature and for every signature the provider rejects- Throws:
IllegalArgumentException- ifkeyormessageis nullTraceCryptoException- with reasoncrypto_unavailableif the provider has no Ed25519Signature, orinvalid_keyif it rejects the key
-