com.ibm.crypto.fips.provider
Class SHA1withRSA
- java.lang.Object
java.security.SignatureSpi
java.security.Signature
com.ibm.crypto.fips.provider.SHA1withRSA
All implemented interfaces:
- public final class SHA1withRSA
- extends java.security.Signature
- implements AlgorithmStatus
Author:
Janelle Zhang
Field Summary
| Fields inherited from class java.security.Signature |
|---|
SIGN, state, UNINITIALIZED, VERIFY |
| Fields inherited from class java.security.SignatureSpi |
|---|
appRandom |
Constructor Summary
| Constructor and Description |
|---|
SHA1withRSA()
Construct a blank RSA object.
|
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
engineGetParameter(java.lang.String key)
Have to implement Signature's abstract method engineGetParameter
to be a concrete class.
|
|
engineInitSign(java.security.PrivateKey privateKey)
Initialize the RSA object with a RSA private key.
|
|
engineInitVerify(java.security.PublicKey publicKey)
Initialize the RSA object with a RSA public key.
|
|
engineSetParameter(java.lang.String key,java.lang.Object param)
Have to implement Signature's abstract method engineSetParameter
to be a concrete class.
|
|
engineSign()
Get message digest for all the data thus far updated, then
sign the message digest.
|
|
engineUpdate(byte b)
Update a byte to be signed or verified.
|
|
engineUpdate(byte[] data,int off,int len)
Update an array of bytes to be signed or verified.
|
|
engineVerify(byte[] signature)
Verify the signature (compare the result with the message digest).
|
|
internalGetParameter(java.lang.String key)
Have to implement Signature's abstract method engineGetParameter
to be a concrete class.
|
|
internalInitSign(java.security.PrivateKey privateKey)
Initialize the RSA object with a RSA private key.
|
|
internalInitVerify(java.security.PublicKey publicKey)
Initialize the RSA object with a RSA public key.
|
|
internalSetParameter(java.lang.String key,java.lang.Object param)
Have to implement Signature's abstract method engineSetParameter
to be a concrete class.
|
|
internalSign()
Get message digest for all the data thus far updated, then
sign the message digest.
|
|
internalUpdate(byte b)
Update a byte to be signed or verified.
|
|
internalUpdate(byte[] data,int off,int len)
Update an array of bytes to be signed or verified.
|
|
internalVerify(byte[] signature)
Verify the signature (compare the result with the message digest).
|
|
isFipsApproved()
|
| 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 |
| Methods inherited from class java.security.SignatureSpi |
|---|
engineGetParameters, engineInitSign, engineSetParameter, engineSign, engineUpdate, engineVerify |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail
SHA1withRSA
- public SHA1withRSA()
- throws java.security.NoSuchAlgorithmException
- java.security.NoSuchProviderException
Construct a blank RSA object. It must be initialized
before being usable for signing or verifying.
Throws:
java.security.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionMethod Detail
isFipsApproved
- public boolean isFipsApproved()
Description copied from interface:
AlgorithmStatus
Module identifies if the cryptographic operation (algorithm) is FIPS certified
Specified by:
isFipsApproved in interface AlgorithmStatus
See Also:
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:
engineSetParameter in class java.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:
engineGetParameter in class java.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.InvalidKeyException
Initialize the RSA object with a RSA private key.
Specified by:
engineInitSign in class java.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.InvalidKeyException
Initialize 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.InvalidKeyException
Initialize the RSA object with a RSA public key.
Specified by:
engineInitVerify in class java.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.InvalidKeyException
Initialize 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:
engineUpdate in class java.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[] data,
- int off,
- int len)
Update an array of bytes to be signed or verified.
Specified by:
engineUpdate in class java.security.SignatureSpi
Parameters:
data - the bytes to be updated. Throws:
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false. internalUpdate
- protected void internalUpdate(byte[] data,
- int off,
- int len)
Update an array of bytes to be signed or verified.
Parameters:
data - the bytes to be updated. engineSign
- protected byte[] engineSign()
- throws java.security.SignatureException
Get message digest for all the data thus far updated, then
sign the message digest.
Specified by:
engineSign in class java.security.SignatureSpi
Returns:
the signature.
Throws:
java.security.SignatureException - if the signature object was not
properly initialized, or if another exception occurs. FIPSRuntimeException - if SelfTest.isFipsRunnable returns false. internalSign
- protected byte[] internalSign()
- throws java.security.SignatureException
Get 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.SignatureException
Verify the signature (compare the result with the message digest).
Specified by:
engineVerify in class java.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.SignatureException
Verify 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.