- java.lang.Object
-
- java.security.SignatureSpi
-
- com.ibm.crypto.ibmjcehybrid.provider.MD5withRSAHybrid
-
public final class MD5withRSAHybrid extends java.security.SignatureSpi
This class is a facade for signatures using MD5 and RSA
-
-
Constructor Summary
Constructors Constructor Description MD5withRSAHybrid()
Creates a new instance of the MD5withRSAHybrid class.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected java.lang.Object
engineGetParameter(java.lang.String key)
Deprecated.Replaced by engineGetParameters()protected java.security.AlgorithmParameters
engineGetParameters()
Call the Signature object's getParameters().protected void
engineInitSign(java.security.PrivateKey privateKey)
Initialize the RSA object with a RSA private key.protected void
engineInitVerify(java.security.PublicKey publicKey)
Initialize the RSA object with a RSA public key.protected void
engineSetParameter(java.lang.String key, java.lang.Object param)
Deprecated.Replaced by engineSetParameter(AlgorithmParameterSpec parmSpec)protected void
engineSetParameter(java.security.spec.AlgorithmParameterSpec parmSpec)
engineSetParameter()protected byte[]
engineSign()
Get the message digest for all the data thus far updated, then sign the message digest.protected void
engineUpdate(byte b)
Add a byte to the digest inside the signature -- this digest will be signed or verified.protected void
engineUpdate(byte[] data)
Add an array of bytes to the digest inside the signature -- this digest will be signed or verified.protected void
engineUpdate(byte[] data, int off, int len)
Add an array of bytes to the digest inside the signature -- this digest will be signed or verified.protected boolean
engineVerify(byte[] signature)
Verify the signature (compare the result with the message digest inside the signature).protected boolean
engineVerify(byte[] signature, int off, int len)
Verify the signature (compare the result with the message digest inside the signature).protected void
getSignature()
Creates an instance of the Signature.
-
-
-
Method Detail
-
engineSetParameter
@Deprecated protected void engineSetParameter(java.lang.String key, java.lang.Object param) throws java.lang.UnsupportedOperationException
Deprecated.Replaced by engineSetParameter(AlgorithmParameterSpec parmSpec)engineSetParameter()- Specified by:
engineSetParameter
in classjava.security.SignatureSpi
- Parameters:
key
- The key for computing (or verifying) the signature.param
- Signature parameters.- Throws:
java.lang.UnsupportedOperationException
- is always thrown see above.
-
engineSetParameter
protected void engineSetParameter(java.security.spec.AlgorithmParameterSpec parmSpec) throws java.security.InvalidAlgorithmParameterException
engineSetParameter()- Overrides:
engineSetParameter
in classjava.security.SignatureSpi
- Parameters:
parmSpec
- The key and value of the parameter- Throws:
java.lang.UnsupportedOperationException
- is always thrown see above.java.security.InvalidAlgorithmParameterException
-
engineGetParameter
@Deprecated protected java.lang.Object engineGetParameter(java.lang.String key) throws java.lang.UnsupportedOperationException
Deprecated.Replaced by engineGetParameters()Call the Signature object's getParameter().- Specified by:
engineGetParameter
in classjava.security.SignatureSpi
- Parameters:
key
- The name of the parameter.- Returns:
- the object representing the value of the specified parameter.
- Throws:
java.lang.UnsupportedOperationException
- if thrown by the object
-
engineGetParameters
protected java.security.AlgorithmParameters engineGetParameters() throws java.lang.UnsupportedOperationException
Call the Signature object's getParameters().- Overrides:
engineGetParameters
in classjava.security.SignatureSpi
- Throws:
java.lang.UnsupportedOperationException
- if thrown by the object
-
engineInitSign
protected void engineInitSign(java.security.PrivateKey privateKey) throws java.security.InvalidKeyException
Initialize the RSA object with a RSA private key.- Specified by:
engineInitSign
in classjava.security.SignatureSpi
- Parameters:
privateKey
- the RSA private key.- Throws:
java.security.InvalidKeyException
- if the key is not a valid RSA private key.
-
engineInitVerify
protected void engineInitVerify(java.security.PublicKey publicKey) throws java.security.InvalidKeyException
Initialize the RSA object with a RSA public key.- Specified by:
engineInitVerify
in 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)
Add a byte to the digest inside the signature -- this digest will be signed or verified.- Specified by:
engineUpdate
in classjava.security.SignatureSpi
- Parameters:
b
- the byte to updated.
-
engineUpdate
protected void engineUpdate(byte[] data)
Add an array of bytes to the digest inside the signature -- this digest will be signed or verified.- Parameters:
data
- the array bytes to be added to the signature.
-
engineUpdate
protected void engineUpdate(byte[] data, int off, int len)
Add an array of bytes to the digest inside the signature -- this digest will be signed or verified.- Specified by:
engineUpdate
in classjava.security.SignatureSpi
- Parameters:
data
- the array bytes to be added to the signature.off
- the offset into the array to start the update.len
- length of the array.
-
engineSign
protected byte[] engineSign() throws java.security.SignatureException
Get the message digest for all the data thus far updated, then sign the message digest.- Specified by:
engineSign
in 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.SignatureException
Verify the signature (compare the result with the message digest inside the signature).- Specified by:
engineVerify
in classjava.security.SignatureSpi
- Parameters:
signature
- the signature to be verified.- Throws:
java.security.SignatureException
- if the signature object was not properly initialized, or if another exception occurs.
-
engineVerify
protected boolean engineVerify(byte[] signature, int off, int len) throws java.security.SignatureException
Verify the signature (compare the result with the message digest inside the signature).- Overrides:
engineVerify
in classjava.security.SignatureSpi
- Parameters:
signature
- the signature to be verified.off
- the offset in signature[] of the signature to be verified.len
- the numbers of bytes in the signature to be verified.- Throws:
java.security.SignatureException
- if the signature object was not properly initialized, or if another exception occurs.
-
getSignature
protected void getSignature()
Creates an instance of the Signature.- Throws:
java.lang.RuntimeException
- if this method fails to create and to initialize the message digest within the signature.
-
-