com.ibm.crypto.fips.provider

Class SHA1withRSA

  1. java.lang.Object
  2. extended byjava.security.SignatureSpi
  3. extended byjava.security.Signature
  4. extended bycom.ibm.crypto.fips.provider.SHA1withRSA
All implemented interfaces:
AlgorithmStatus

  1. public final class SHA1withRSA
  2. extends java.security.Signature
  3. implements AlgorithmStatus
This class implements the SHA1withRSA
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
  1. protected
  2. java.lang.Object
engineGetParameter(java.lang.String key)
Have to implement Signature's abstract method engineGetParameter to be a concrete class.
  1. protected
  2. void
engineInitSign(java.security.PrivateKey privateKey)
Initialize the RSA object with a RSA private key.
  1. protected
  2. void
engineInitVerify(java.security.PublicKey publicKey)
Initialize the RSA object with a RSA public key.
  1. protected
  2. void
engineSetParameter(java.lang.String key,java.lang.Object param)
Have to implement Signature's abstract method engineSetParameter to be a concrete class.
  1. protected
  2. byte[]
engineSign()
Get message digest for all the data thus far updated, then sign the message digest.
  1. protected
  2. void
engineUpdate(byte b)
Update a byte to be signed or verified.
  1. protected
  2. void
engineUpdate(byte[] data,int off,int len)
Update an array of bytes to be signed or verified.
  1. protected
  2. boolean
engineVerify(byte[] signature)
Verify the signature (compare the result with the message digest).
  1. protected
  2. java.lang.Object
internalGetParameter(java.lang.String key)
Have to implement Signature's abstract method engineGetParameter to be a concrete class.
  1. protected
  2. void
internalInitSign(java.security.PrivateKey privateKey)
Initialize the RSA object with a RSA private key.
  1. protected
  2. void
internalInitVerify(java.security.PublicKey publicKey)
Initialize the RSA object with a RSA public key.
  1. protected
  2. void
internalSetParameter(java.lang.String key,java.lang.Object param)
Have to implement Signature's abstract method engineSetParameter to be a concrete class.
  1. protected
  2. byte[]
internalSign()
Get message digest for all the data thus far updated, then sign the message digest.
  1. protected
  2. void
internalUpdate(byte b)
Update a byte to be signed or verified.
  1. protected
  2. void
internalUpdate(byte[] data,int off,int len)
Update an array of bytes to be signed or verified.
  1. protected
  2. boolean
internalVerify(byte[] signature)
Verify the signature (compare the result with the message digest).
  1. boolean
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

  1. public SHA1withRSA()
  2. throws java.security.NoSuchAlgorithmException
  3. java.security.NoSuchProviderException
Construct a blank RSA object. It must be initialized before being usable for signing or verifying.
Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException

Method Detail

isFipsApproved

  1. public boolean isFipsApproved()
Description copied from interface: AlgorithmStatus
Module identifies if the cryptographic operation (algorithm) is FIPS certified
Specified by:
See Also:

engineSetParameter

  1. protected void engineSetParameter( java.lang.String key,
  2. 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

  1. protected void internalSetParameter( java.lang.String key,
  2. java.lang.Object param)
Have to implement Signature's abstract method engineSetParameter to be a concrete class.

engineGetParameter

  1. 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

  1. protected java.lang.Object internalGetParameter( java.lang.String key)
Have to implement Signature's abstract method engineGetParameter to be a concrete class.

engineInitSign

  1. protected void engineInitSign(java.security.PrivateKey privateKey)
  2. 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

  1. protected void internalInitSign( java.security.PrivateKey privateKey)
  2. 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

  1. protected void engineInitVerify( java.security.PublicKey publicKey)
  2. 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

  1. protected void internalInitVerify( java.security.PublicKey publicKey)
  2. 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

  1. 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

  1. protected void internalUpdate(byte b)
Update a byte to be signed or verified.
Parameters:
b - the byte to updated.

engineUpdate

  1. protected void engineUpdate(byte[] data,
  2. int off,
  3. 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

  1. protected void internalUpdate(byte[] data,
  2. int off,
  3. int len)
Update an array of bytes to be signed or verified.
Parameters:
data - the bytes to be updated.

engineSign

  1. protected byte[] engineSign()
  2. 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

  1. protected byte[] internalSign()
  2. 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

  1. protected boolean engineVerify( byte[] signature)
  2. 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

  1. protected boolean internalVerify( byte[] signature)
  2. 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.