com.ibm.crypto.provider
Class MD2withRSA

java.lang.Object
  |
  +--java.security.SignatureSpi
        |
        +--java.security.Signature
              |
              +--com.ibm.crypto.provider.MD2withRSA

public final class MD2withRSA
extends Signature

This class implements MD2 with RSA


Fields inherited from class java.security.Signature
SIGN, state, UNINITIALIZED, VERIFY
 
Fields inherited from class java.security.SignatureSpi
appRandom
 
Constructor Summary
MD2withRSA()
          Construct a blank RSA object.
 
Method Summary
protected  Object engineGetParameter(String key)
          Have to implement Signature's abstract method engineGetParameter to be a concrete class.
protected  void engineInitSign(PrivateKey privateKey)
          Initialize the RSA object with a RSA private key.
protected  void engineInitVerify(PublicKey publicKey)
          Initialize the RSA object with a RSA public key.
protected  void engineSetParameter(String key, 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).
 
Methods inherited from class java.security.Signature
clone, getAlgorithm, getInstance, getInstance, getParameter, getProvider, initSign, initSign, 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

MD2withRSA

public MD2withRSA()
Construct a blank RSA object. It must be initialized before being usable for signing or verifying.
Method Detail

engineSetParameter

protected void engineSetParameter(String key,
                                  Object param)
Have to implement Signature's abstract method engineSetParameter to be a concrete class.
Overrides:
engineSetParameter in class SignatureSpi

engineGetParameter

protected Object engineGetParameter(String key)
Have to implement Signature's abstract method engineGetParameter to be a concrete class.
Overrides:
engineGetParameter in class SignatureSpi

engineInitSign

protected void engineInitSign(PrivateKey privateKey)
                       throws InvalidKeyException
Initialize the RSA object with a RSA private key.
Overrides:
engineInitSign in class SignatureSpi
Parameters:
privateKey - the RSA private key
Throws:
InvalidKeyException - if the key is not a valid RSA private key.

engineInitVerify

protected void engineInitVerify(PublicKey publicKey)
                         throws InvalidKeyException
Initialize the RSA object with a RSA public key.
Overrides:
engineInitVerify in class SignatureSpi
Parameters:
publicKey - the RSA public key
Throws:
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 SignatureSpi
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 SignatureSpi
Parameters:
data - the bytes to be updated.

engineSign

protected byte[] engineSign()
                     throws SignatureException
Get message digest for all the data thus far updated, then sign the message digest.
Overrides:
engineSign in class SignatureSpi
Returns:
the signature.
Throws:
SignatureException - if the signature object was not properly initialized, or if another exception occurs.

engineVerify

protected boolean engineVerify(byte[] signature)
                        throws SignatureException
Verify the signature (compare the result with the message digest).
Overrides:
engineVerify in class SignatureSpi
Throws:
SignatureException - if the signature object was not properly initialized, or if another exception occurs.