Class ModuleLatticeDsaExample
java.lang.Object
net.jrodolfo.java_evolution.java24.quantum_resistant_crypto.ModuleLatticeDsaExample
Demonstrates Java 24 module-lattice digital signature support.
ML-DSA is a post-quantum digital signature algorithm. A private key signs a message, and the matching public key verifies that the signature belongs to the original message. The example also verifies that a tampered message is rejected.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsignAndVerify(String message) Signs a message and verifies both the original and a tampered message.
-
Field Details
-
ALGORITHM
Standard algorithm name for module-lattice digital signatures.- See Also:
-
-
Constructor Details
-
ModuleLatticeDsaExample
public ModuleLatticeDsaExample()
-
-
Method Details
-
signAndVerify
public ModuleLatticeDsaResult signAndVerify(String message) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException Signs a message and verifies both the original and a tampered message.- Parameters:
message- the message to sign- Returns:
- the signature bytes and verification outcomes
- Throws:
NoSuchAlgorithmException- if ML-DSA is not available from the active providersInvalidKeyException- if generated keys cannot be used by the signature providerSignatureException- if the signature operation fails
-