Package netscape.security.provider
Class DSA
- java.lang.Object
-
- java.security.SignatureSpi
-
- java.security.Signature
-
- netscape.security.provider.DSA
-
public final class DSA extends java.security.SignatureThe Digital Signature Standard (using the Digital Signature Algorithm), as described in fips186 of the National Instute of Standards and Technology (NIST), using fips180-1 (SHA-1).- Version:
- 1.86, 97/09/17
- Author:
- Benjamin Renaud
- See Also:
DSAPublicKey,DSAPrivateKey
-
-
Constructor Summary
Constructors Constructor Description DSA()Construct a blank DSA object.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected java.lang.ObjectengineGetParameter(java.lang.String key)Deprecated.protected voidengineInitSign(java.security.PrivateKey privateKey)Initialize the DSA object with a DSA private key.protected voidengineInitVerify(java.security.PublicKey publicKey)Initialize the DSA object with a DSA public key.protected voidengineSetParameter(java.lang.String key, java.lang.Object param)Deprecated.protected byte[]engineSign()Sign all the data thus far updated.protected voidengineUpdate(byte b)Update a byte to be signed or verified.protected voidengineUpdate(byte[] data, int off, int len)Update an array of bytes to be signed or verified.protected booleanengineVerify(byte[] signature)Verify all the data thus far updated.java.lang.StringtoString()Return a human readable rendition of the engine.-
Methods inherited from class java.security.Signature
clone, getAlgorithm, getInstance, getInstance, getInstance, getParameter, getParameters, getProvider, initSign, initSign, initVerify, initVerify, setParameter, setParameter, sign, sign, update, update, update, update, verify, verify
-
-
-
-
Method Detail
-
engineInitSign
protected void engineInitSign(java.security.PrivateKey privateKey) throws java.security.InvalidKeyExceptionInitialize the DSA object with a DSA private key.- Specified by:
engineInitSignin classjava.security.SignatureSpi- Parameters:
privateKey- the DSA private key- Throws:
java.security.InvalidKeyException- if the key is not a valid DSA private key.
-
engineInitVerify
protected void engineInitVerify(java.security.PublicKey publicKey) throws java.security.InvalidKeyExceptionInitialize the DSA object with a DSA public key.- Specified by:
engineInitVerifyin classjava.security.SignatureSpi- Parameters:
publicKey- the DSA public key.- Throws:
java.security.InvalidKeyException- if the key is not a valid DSA public key.
-
engineSign
protected byte[] engineSign() throws java.security.SignatureExceptionSign all the data thus far updated. The signature is formatted according to the Canonical Encoding Rules, returned as a DER sequence of Integer, r and s.- Specified by:
engineSignin classjava.security.SignatureSpi- Returns:
- a signature block formatted according to the Canonical Encoding Rules.
- Throws:
java.security.SignatureException- if the signature object was not properly initialized, or if another exception occurs.- See Also:
engineUpdate(byte),engineVerify(byte[])
-
engineVerify
protected boolean engineVerify(byte[] signature) throws java.security.SignatureExceptionVerify all the data thus far updated.- Specified by:
engineVerifyin classjava.security.SignatureSpi- Parameters:
signature- the alledged signature, encoded using the Canonical Encoding Rules, as a sequence of integers, r and s.- Throws:
java.security.SignatureException- if the signature object was not properly initialized, or if another exception occurs.- See Also:
engineUpdate(byte),engineSign()
-
engineSetParameter
protected void engineSetParameter(java.lang.String key, java.lang.Object param)Deprecated.This implementation recognizes the following parameter:- Kseed
- a byte array.
- Specified by:
engineSetParameterin classjava.security.SignatureSpi
-
engineGetParameter
protected java.lang.Object engineGetParameter(java.lang.String key)
Deprecated.Return the value of the requested parameter. Recognized parameters are:- Kseed
- a byte array.
- Specified by:
engineGetParameterin classjava.security.SignatureSpi- Returns:
- the value of the requested parameter.
-
engineUpdate
protected void engineUpdate(byte b)
Update a byte to be signed or verified.- Specified by:
engineUpdatein classjava.security.SignatureSpi- Parameters:
b- the byte to updated.
-
engineUpdate
protected void engineUpdate(byte[] data, int off, int len)Update an array of bytes to be signed or verified.- Specified by:
engineUpdatein classjava.security.SignatureSpi- Parameters:
data- the bytes to be updated.
-
toString
public java.lang.String toString()
Return a human readable rendition of the engine.- Overrides:
toStringin classjava.security.Signature
-
-