com.ibm.crypto.hdwrCCA.provider
Class SHA1withDSA
- java.lang.Object
-
- java.security.SignatureSpi
-
- com.ibm.crypto.hdwrCCA.provider.SHA1withDSA
-
public class SHA1withDSA extends java.security.SignatureSpiThis class is a concrete implementation for DSA signing with SHA1.
-
-
Constructor Summary
Constructors Constructor and Description SHA1withDSA()Constructs a new instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description protected java.lang.ObjectengineGetParameter(java.lang.String param)Deprecated.protected voidengineInitSign(java.security.PrivateKey privateKey)Initialize the receiver with the specified private key, to be used for signing purposes.protected voidengineInitVerify(java.security.PublicKey publicKey)Initialize the receiver with the specified public key, to be used for verification purposes.protected voidengineSetParameter(java.lang.String param, java.lang.Object value)Deprecated.protected byte[]engineSign()Get message digest for all the data thus far updated, then sign the message digest.protected voidengineUpdate(byte b)Update the bytes signed so far with the extra byte provided.protected voidengineUpdate(byte[] buffer, int offset, int length)Update the bytes signed so far with the extra bytes provided.protected booleanengineVerify(byte[] sigBytes)Verifies the passed signature.java.lang.StringtoString()Answers a string containing a concise, human-readable description of the receiver.
-
-
-
Constructor Detail
-
SHA1withDSA
public SHA1withDSA() throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderExceptionConstructs a new instance of this class.- Throws:
java.security.NoSuchAlgorithmException- is thrown when the Algorithm can not be found.java.security.NoSuchProviderException- is thrown when the provider can not be found.
-
-
Method Detail
-
engineGetParameter
protected java.lang.Object engineGetParameter(java.lang.String param) throws java.lang.UnsupportedOperationExceptionDeprecated.Have to implement Signature's abstract method engineSetParameter to be a concrete class. However, this method has no meaning for this provider.- Specified by:
engineGetParameterin classjava.security.SignatureSpi- Throws:
java.lang.UnsupportedOperationException- is always thrown.
-
engineInitSign
protected void engineInitSign(java.security.PrivateKey privateKey) throws java.security.InvalidKeyExceptionInitialize the receiver with the specified private key, to be used for signing purposes.- Specified by:
engineInitSignin classjava.security.SignatureSpi- Parameters:
privateKey- the key to be used when signing.- Throws:
java.security.InvalidKeyException- if the specified key is not a valid DSA private key (improperly encoded, parameters missing, etc).
-
engineInitVerify
protected void engineInitVerify(java.security.PublicKey publicKey) throws java.security.InvalidKeyExceptionInitialize the receiver with the specified public key, to be used for verification purposes.- Specified by:
engineInitVerifyin classjava.security.SignatureSpi- Parameters:
publicKey- the key to be used when verifying.- Throws:
java.security.InvalidKeyException- if the specified key is not valid (improperly encoded, parameters missing, etc).
-
engineSetParameter
protected void engineSetParameter(java.lang.String param, java.lang.Object value) throws java.lang.UnsupportedOperationExceptionDeprecated.Have to implement Signature's abstract method engineGetParameter to be a concrete class. However, this method has no meaning for this provider.- Specified by:
engineSetParameterin classjava.security.SignatureSpi- Throws:
java.lang.UnsupportedOperationException- is always thrown.
-
engineSign
protected byte[] engineSign() throws java.security.SignatureExceptionGet message digest for all the data thus far updated, then sign the message digest.- Specified by:
engineSignin classjava.security.SignatureSpi- Returns:
- the signature bytes of the data updated so far.
- Throws:
java.security.SignatureException- if the engine is not initialized properly.
-
engineUpdate
protected void engineUpdate(byte b) throws java.security.SignatureExceptionUpdate the bytes signed so far with the extra byte provided.- Specified by:
engineUpdatein classjava.security.SignatureSpi- Parameters:
b- the extra byte to be signed.- Throws:
java.security.SignatureException- if the receiver is not initialized properly.
-
engineUpdate
protected void engineUpdate(byte[] buffer, int offset, int length) throws java.security.SignatureExceptionUpdate the bytes signed so far with the extra bytes provided.- Specified by:
engineUpdatein classjava.security.SignatureSpi- Parameters:
buffer- the extra bytes to be signed.offset- offset in the buffer where to start getting bytes for signing.length- how many bytes to get for signing.- Throws:
java.security.SignatureException- if the receiver is not initialized properly.
-
engineVerify
protected boolean engineVerify(byte[] sigBytes) throws java.security.SignatureExceptionVerifies the passed signature.- Specified by:
engineVerifyin classjava.security.SignatureSpi- Parameters:
sigBytes- the signature bytes to verify.- Returns:
- returns true if the signature was verified successfully, false otherwise.
- Throws:
java.security.SignatureException- if the receiver is not initialized properly or if the key is not encoded properly.
-
toString
public java.lang.String toString()
Answers a string containing a concise, human-readable description of the receiver.- Overrides:
toStringin classjava.lang.Object- Returns:
- a printable representation for the receiver.
-
-