public class SHA3_224withDSA extends DSA
For signing some data call the Signature
getInstance
, initSign
,
update
and sign
methods, respectively, e.g.:
byte[] message = ...; Signature dsa = Signature.getInstance("SHA3-224withDSA", "IAIK"); PrivateKey privateKey = ...; // init Signature object with private key dsa.initSign(privateKey); // supply the data to be signed by as many update calls as necessary dsa.update(message); // create the signature byte[] dsasig = dsa.sign();For verifying a signature call the
Signature
getInstance
, initVerify
, update
and verify
methods, respectively, e.g.:
byte[] message = ...;
Signature dsa = Signature.getInstance("SHA3-224withDSA", "IAIK");
PublicKey publicKey = ...;
// init Signature object with public key
dsa.initVerify(publicKey);
// supply the data that has been signed by as many update calls as necessary
dsa.update(message);
// verify the signature
if (dsa.verify(dsasig) == false){
throw new SignatureException("Signature invalid.");
}
Constructor and Description |
---|
SHA3_224withDSA()
Default constructor.
|
engineGetParameter, engineGetParameters, engineInitSign, engineInitSign, engineInitVerify, engineSetParameter, engineSetParameter, engineSign, engineUpdate, engineUpdate, engineVerify, setCheckSigValueForDERCompliance, setDoVerifySignature, setUseBachwardsCompatibilityMode, setUseBlinding
public SHA3_224withDSA() throws java.security.NoSuchAlgorithmException
Signature.getInstance("SHA3-224withDSA")
method.java.security.NoSuchAlgorithmException
- if the SHA3-224 MessageDigest
algorithm is not available