com.ibm.crypto.hdwrCCA.provider
Class MD5withRSA
- java.lang.Object
-
- java.security.SignatureSpi
-
- com.ibm.crypto.hdwrCCA.provider.MD5withRSA
-
public final class MD5withRSA extends java.security.SignatureSpiThis class implements signatures using MD5 and RSA
-
-
Constructor Summary
Constructors Constructor and Description MD5withRSA()Construct a blank RSA object.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description protected java.lang.ObjectengineGetParameter(java.lang.String key)Deprecated.protected voidengineInitSign(java.security.PrivateKey privateKey)Initialize this signature object with a RSA private key.protected voidengineInitVerify(java.security.PublicKey publicKey)Initialize the RSA object with a RSA public key.protected voidengineSetParameter(java.lang.String key, java.lang.Object param)Deprecated.protected byte[]engineSign()Get message digest for all the data thus far updated, then sign the message digest.protected voidengineUpdate(byte b)Update digest with the passed in byte.protected voidengineUpdate(byte[] data, int off, int len)Update digest with an array of bytes.protected booleanengineVerify(byte[] signature)Verify the signature (compare the result with the message digest).
-
-
-
Constructor Detail
-
MD5withRSA
public MD5withRSA() throws java.lang.RuntimeExceptionConstruct a blank RSA object. It must be initialized before being usable for signing or verifying.- Throws:
java.lang.RuntimeException- Program error has occurred.
-
-
Method Detail
-
engineSetParameter
protected void engineSetParameter(java.lang.String key, java.lang.Object 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:
engineSetParameterin classjava.security.SignatureSpi- Throws:
java.lang.UnsupportedOperationException- is always thrown.
-
engineGetParameter
protected java.lang.Object engineGetParameter(java.lang.String key) 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 this signature object with a RSA private key.- Specified by:
engineInitSignin classjava.security.SignatureSpi- Parameters:
privateKey- the RSA private key- Throws:
java.security.InvalidKeyException- ifprivateKeyis not a valid RSA private key.
-
engineInitVerify
protected void engineInitVerify(java.security.PublicKey publicKey) throws java.security.InvalidKeyExceptionInitialize the RSA object with a RSA public key.- Specified by:
engineInitVerifyin classjava.security.SignatureSpi- Parameters:
publicKey- the RSA public key.- Throws:
java.security.InvalidKeyException- if the key is not a valid RSA public key.
-
engineUpdate
protected void engineUpdate(byte b)
Update digest with the passed in byte.- Specified by:
engineUpdatein classjava.security.SignatureSpi- Parameters:
b- the byte to updated.
-
engineUpdate
protected void engineUpdate(byte[] data, int off, int len)Update digest with an array of bytes.- Specified by:
engineUpdatein classjava.security.SignatureSpi- Parameters:
data- the array of bytes to add to digest.off- offset into array for the bytes to be added.len- length of the array.
-
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.
- Throws:
java.security.SignatureException- if the signature object was not properly initialized, or if another exception occurs.
-
engineVerify
protected boolean engineVerify(byte[] signature) throws java.security.SignatureExceptionVerify the signature (compare the result with the message digest).- Specified by:
engineVerifyin classjava.security.SignatureSpi- Throws:
java.security.SignatureException- if the signature object was not properly initialized, or if another exception occurs.
-
-