com.ibm.crypto.fips.provider
Class DatawithRSA
- java.lang.Object
-
- java.security.SignatureSpi
-
- java.security.Signature
-
- com.ibm.crypto.fips.provider.DatawithRSA
-
public final class DatawithRSA extends java.security.SignatureThis class implements signature without this algorithm doing the hashing with RSA
-
-
Constructor Summary
Constructors Constructor and Description DatawithRSA()Construct a blank RSA object.
-
Method Summary
Methods Modifier and Type Method and Description protected java.lang.ObjectengineGetParameter(java.lang.String key)Have to implement Signature's abstract method engineGetParameter to be a concrete class.protected voidengineInitSign(java.security.PrivateKey privateKey)Initialize the RSA 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)Have to implement Signature's abstract method engineSetParameter to be a concrete class.protected byte[]engineSign()Get message digest for all the data thus far updated, then sign the message digest.protected voidengineUpdate(byte b)Update a byte to be signed or verified.protected voidengineUpdate(byte[] dataBuf, int off, int len)Update an array of bytes to be signed or verified.protected booleanengineVerify(byte[] signature)Verify the signature (compare the result with the message digest).protected voidfinalize()This function resets the class variables.protected java.lang.ObjectinternalGetParameter(java.lang.String key)Have to implement Signature's abstract method engineGetParameter to be a concrete class.protected voidinternalInitSign(java.security.PrivateKey privateKey)Initialize the RSA object with a RSA private key.protected voidinternalInitVerify(java.security.PublicKey publicKey)Initialize the RSA object with a RSA public key.protected voidinternalSetParameter(java.lang.String key, java.lang.Object param)Have to implement Signature's abstract method engineSetParameter to be a concrete class.protected byte[]internalSign()Get message digest for all the data thus far updated, then sign the message digest.protected voidinternalUpdate(byte b)Update a byte to be signed or verified.protected booleaninternalVerify(byte[] signature)Verify the signature (compare the result with the message digest).-
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, verify
-
-
-
-
Constructor Detail
-
DatawithRSA
public DatawithRSA()
Construct a blank RSA object. It must be initialized before being usable for signing or verifying.
-
-
Method Detail
-
engineSetParameter
protected void engineSetParameter(java.lang.String key, java.lang.Object param)Have to implement Signature's abstract method engineSetParameter to be a concrete class.- Specified by:
engineSetParameterin classjava.security.SignatureSpi- Throws:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalSetParameter
protected void internalSetParameter(java.lang.String key, java.lang.Object param)Have to implement Signature's abstract method engineSetParameter to be a concrete class.
-
engineGetParameter
protected java.lang.Object engineGetParameter(java.lang.String key)
Have to implement Signature's abstract method engineGetParameter to be a concrete class.- Specified by:
engineGetParameterin classjava.security.SignatureSpi- Throws:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalGetParameter
protected java.lang.Object internalGetParameter(java.lang.String key)
Have to implement Signature's abstract method engineGetParameter to be a concrete class.
-
engineInitSign
protected void engineInitSign(java.security.PrivateKey privateKey) throws java.security.InvalidKeyExceptionInitialize the RSA object with a RSA private key.- Specified by:
engineInitSignin classjava.security.SignatureSpi- Parameters:
privateKey- the RSA private key- Throws:
java.security.InvalidKeyException- if the key is not a valid RSA private key.FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalInitSign
protected void internalInitSign(java.security.PrivateKey privateKey) throws java.security.InvalidKeyExceptionInitialize the RSA object with a RSA private key.- 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.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.FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalInitVerify
protected void internalInitVerify(java.security.PublicKey publicKey) throws java.security.InvalidKeyExceptionInitialize the RSA object with a RSA public key.- 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 a byte to be signed or verified.- Specified by:
engineUpdatein classjava.security.SignatureSpi- Parameters:
b- the byte to updated.- Throws:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalUpdate
protected void internalUpdate(byte b)
Update a byte to be signed or verified.- Parameters:
b- the byte to updated.
-
engineUpdate
protected void engineUpdate(byte[] dataBuf, 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.
-
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:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.java.security.SignatureException- if the signature object was not properly initialized, or if another exception occurs.
-
internalSign
protected byte[] internalSign() throws java.security.SignatureExceptionGet message digest for all the data thus far updated, then sign the message digest.- 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.FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalVerify
protected boolean internalVerify(byte[] signature) throws java.security.SignatureExceptionVerify the signature (compare the result with the message digest).- Throws:
java.security.SignatureException- if the signature object was not properly initialized, or if another exception occurs.
-
finalize
protected void finalize()
This function resets the class variables.- Overrides:
finalizein classjava.lang.Object
-
-