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:
AlgorithmStatus

public final class SHA1withRSA
extends java.security.Signature
implements AlgorithmStatus

This class implements the SHA1withRSA

Version:
1.00, 03/16/99
Author:
Janelle Zhang

Fields inherited from class java.security.Signature
SIGN, state, UNINITIALIZED, VERIFY
 
Fields inherited from class java.security.SignatureSpi
appRandom
 
Constructor Summary
SHA1withRSA()
          Construct a blank RSA object.
 
Method Summary
protected  java.lang.Object engineGetParameter(java.lang.String key)
          Have to implement Signature's abstract method engineGetParameter to be a concrete class.
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)
          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  void engineUpdate(byte b)
          Update a byte to be signed or verified.
protected  void engineUpdate(byte[] data, int off, int len)
          Update an array of bytes to be signed or verified.
protected  boolean engineVerify(byte[] signature)
          Verify the signature (compare the result with the message digest).
protected  java.lang.Object internalGetParameter(java.lang.String key)
          Have to implement Signature's abstract method engineGetParameter to be a concrete class.
protected  void internalInitSign(java.security.PrivateKey privateKey)
          Initialize the RSA object with a RSA private key.
protected  void internalInitVerify(java.security.PublicKey publicKey)
          Initialize the RSA object with a RSA public key.
protected  void internalSetParameter(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  void internalUpdate(byte b)
          Update a byte to be signed or verified.
protected  void internalUpdate(byte[] data, int off, int len)
          Update an array of bytes to be signed or verified.
protected  boolean internalVerify(byte[] signature)
          Verify the signature (compare the result with the message digest).
 boolean isFipsApproved()
          Module identifies if the cryptographic operation (algorithm) is FIPS certified
 
Methods inherited from class java.security.Signature
clone, getAlgorithm, getInstance, getInstance, getParameter, getProvider, initSign, initSign, initVerify, initVerify, setParameter, setParameter, sign, sign, toString, update, update, update, verify
 
Methods inherited from class java.security.SignatureSpi
engineInitSign, engineSetParameter, engineSign
 
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.
Method 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:
AlgorithmStatus.isFipsApproved()

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.
Overrides:
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.
Overrides:
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.
Overrides:
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.
Overrides:
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.
Overrides:
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.
Overrides:
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.
Overrides:
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).
Overrides:
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.