public class SHA224withDSA extends DSA
For signing some data call the Signature
getInstance, initSign,
update and sign methods, respectively, e.g.:
byte[] message = ...;
Signature dsa = Signature.getInstance("SHA224withDSA", "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("SHA224withDSA", "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 |
|---|
SHA224withDSA()
Default constructor.
|
engineGetParameter, engineGetParameters, engineInitSign, engineInitSign, engineInitVerify, engineSetParameter, engineSetParameter, engineSign, engineUpdate, engineUpdate, engineVerify, setCheckSigValueForDERCompliance, setDoVerifySignature, setUseBachwardsCompatibilityMode, setUseBlindingpublic SHA224withDSA()
throws java.security.NoSuchAlgorithmException
Signature.getInstance("SHA224withDSA") method.java.security.NoSuchAlgorithmException - if the SHA224 MessageDigest
algorithm is not available