Class SHA1withDSA_SignatureImpl
java.lang.Object
java.security.SignatureSpi
java.security.Signature
org.apache.harmony.security.provider.crypto.SHA1withDSA_SignatureImpl
public class SHA1withDSA_SignatureImpl extends Signature
-
Field Summary
Fields inherited from class java.security.Signature
SIGN, state, UNINITIALIZED, VERIFYFields inherited from class java.security.SignatureSpi
appRandom -
Constructor Summary
Constructors Constructor Description SHA1withDSA_SignatureImpl()The solo constructor. -
Method Summary
Modifier and Type Method Description protected ObjectengineGetParameter(String param)Deprecated method.protected voidengineInitSign(PrivateKey privateKey)Initializes this signature object with PrivateKey object passed as argument to the method.protected voidengineInitVerify(PublicKey publicKey)Initializes this signature object with PublicKey object passed as argument to the method.protected voidengineSetParameter(String param, Object value)Sets the specified parameter to the given value.protected byte[]engineSign()Returns signature bytes as byte array containing ASN1 representation for two BigInteger objects which is SEQUENCE of two INTEGERS.protected voidengineUpdate(byte b)Updates data to sign or to verify.protected voidengineUpdate(byte[] b, int off, int len)Updates data to sign or to verify.protected booleanengineVerify(byte[] sigBytes)Verifies the signature bytes.protected booleanengineVerify(byte[] sigBytes, int offset, int length)Verifies the signature bytes.Methods inherited from class java.security.Signature
clone, getAlgorithm, getInstance, getInstance, getInstance, getParameter, getParameters, getProvider, initSign, initSign, initVerify, initVerify, setParameter, setParameter, sign, sign, toString, update, update, update, update, verify, verifyMethods inherited from class java.security.SignatureSpi
engineGetParameters, engineInitSign, engineSetParameter, engineSign, engineUpdate
-
Constructor Details
-
SHA1withDSA_SignatureImpl
The solo constructor.- Throws:
NoSuchAlgorithmException
-
-
Method Details
-
engineGetParameter
Deprecated method.- Specified by:
engineGetParameterin classSignatureSpi- Parameters:
param- the name of the requested parameter value.- Returns:
- null
- Throws:
InvalidParameterException- ifparamis not a valid parameter for thisSignatureSpior an other error occurs.
-
engineInitSign
Initializes this signature object with PrivateKey object passed as argument to the method.- Specified by:
engineInitSignin classSignatureSpi- Parameters:
privateKey- the private key.- Throws:
InvalidKeyException- if privateKey is not DSAPrivateKey object
-
engineInitVerify
Initializes this signature object with PublicKey object passed as argument to the method.- Specified by:
engineInitVerifyin classSignatureSpi- Parameters:
publicKey- the public key.- Throws:
InvalidKeyException- if publicKey is not DSAPublicKey object
-
engineSetParameter
Description copied from class:SignatureSpiSets the specified parameter to the given value.- Specified by:
engineSetParameterin classSignatureSpi- Parameters:
param- the name of the parameter.value- the parameter value.- Throws:
InvalidParameterException- if the parameter is invalid, already set or is not allowed to be changed.
-
engineSign
Returns signature bytes as byte array containing ASN1 representation for two BigInteger objects which is SEQUENCE of two INTEGERS. Length of sequence varies from less than 46 to 48. Resets object to the state it was in when previous call to either "initSign" method was called.- Specified by:
engineSignin classSignatureSpi- Returns:
- byte array containing signature in ASN1 representation
- Throws:
SignatureException- if object's state is not SIGN or signature algorithm cannot process data
-
engineUpdate
Updates data to sign or to verify.- Specified by:
engineUpdatein classSignatureSpi- Parameters:
b- the byte to update with.- Throws:
SignatureException- if object was not initialized for signing or verifying
-
engineUpdate
Updates data to sign or to verify.- Specified by:
engineUpdatein classSignatureSpi- Parameters:
b- the byte array to update with.off- the start index inbof the data.len- the number of bytes to use.- Throws:
SignatureException- if object was not initialized for signing or verifying
-
engineVerify
Verifies the signature bytes.- Specified by:
engineVerifyin classSignatureSpi- Parameters:
sigBytes- the signature to verify.- Returns:
- true if signature bytes were verified, false otherwise
- Throws:
SignatureException- if object's state is not VERIFY or signature format is not ASN1 representation or signature algorithm cannot process data
-
engineVerify
Verifies the signature bytes.- Overrides:
engineVerifyin classSignatureSpi- Parameters:
sigBytes- thebyte[]containing the signature to verify.offset- the start index insigBytesof the signaturelength- the number of bytes allocated for the signature.- Returns:
- true if signature bytes were verified, false otherwise
- Throws:
SignatureException- if object's state is not VERIFY or signature format is not ASN1 representation or signature algorithm cannot process data
-