All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iaik.security.rsa.SSLRSASignature

java.lang.Object
   |
   +----java.security.Signature
           |
           +----iaik.security.rsa.SSLRSASignature

public class SSLRSASignature
extends Signature
This class implements a special form of a RSA Signature as defined in SSL v3.0.

See Also:
Md5RSASignature, ShaRSASignature

Variable Index

 o md5
 o sha

Constructor Index

 o SSLRSASignature()
The default constructor.

Method Index

 o engineGetParameter(String)
SPI: Gets the value of the specified algorithm parameter.
 o engineInitSign(PrivateKey)
SPI:Initializes this signature object with the specified private key for signing operations.
 o engineInitVerify(PublicKey)
SPI: Initializes this signature object with the specified public key for verification operations.
 o engineSetParameter(String, Object)
SPI: Sets the specified algorithm parameter to the specified value.
 o engineSign()
SPI: Returns the signature bytes of all the data updated so far.
 o engineUpdate(byte)
SPI: Updates the data to be signed or verified using the specified byte.
 o engineUpdate(byte[], int, int)
SPI: Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.
 o engineVerify(byte[])
Verifies the signature of a message defined in SSL v3.0.

Variables

 o md5
 protected MessageDigest md5
 o sha
 protected MessageDigest sha

Constructors

 o SSLRSASignature
 public SSLRSASignature() throws NoSuchAlgorithmException
The default constructor. Creates a new SSL/RSA Signature object.

Throws: NoSuchAlgorithmException
if there is no implementation for MD5 or SHA

Methods

 o engineInitVerify
 protected void engineInitVerify(PublicKey pk) throws InvalidKeyException
SPI: Initializes this signature object with the specified public key for verification operations.

Parameters:
publicKey - a public key.
Throws: InvalidKeyException
if the key is improperly encoded, parameters are missing, and so on.
Overrides:
engineInitVerify in class Signature
 o engineInitSign
 protected void engineInitSign(PrivateKey pk) throws InvalidKeyException
SPI:Initializes this signature object with the specified private key for signing operations.

Parameters:
privateKey - a private key.
Throws: InvalidKeyException
if the key is improperly encoded, parameters are missing, and so on.
Overrides:
engineInitSign in class Signature
 o engineSign
 protected byte[] engineSign() throws SignatureException
SPI: Returns the signature bytes of all the data updated so far. The signature is returned as defined in SSL v3.0.

Returns:
the signature bytes of the signing operation's result.
Throws: SignatureException
if the signature is not initialized properly or an other problem occurs.
Overrides:
engineSign in class Signature
 o engineVerify
 protected boolean engineVerify(byte sigBytes[]) throws SignatureException
Verifies the signature of a message defined in SSL v3.0.

Parameters:
sigBytes - the RSA encrypted digest
Returns:
true if signature is OK
Throws: SignatureException
if the signature is not initialized properly, or it is improperly encoded or of the wrong type, etc.
Overrides:
engineVerify in class Signature
 o engineUpdate
 protected void engineUpdate(byte b)
SPI: Updates the data to be signed or verified using the specified byte.

Parameters:
b - the byte to update.
Overrides:
engineUpdate in class Signature
 o engineUpdate
 protected void engineUpdate(byte b[],
                             int off,
                             int len)
SPI: Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.

Parameters:
data - the array of bytes.
off - the offset to start from in the array of bytes.
len - the number of bytes to use, starting at offset.
Overrides:
engineUpdate in class Signature
 o engineSetParameter
 protected void engineSetParameter(String param,
                                   Object value) throws InvalidParameterException
SPI: Sets the specified algorithm parameter to the specified value. This method is not implemented.

Overrides:
engineSetParameter in class Signature
 o engineGetParameter
 protected Object engineGetParameter(String param) throws InvalidParameterException
SPI: Gets the value of the specified algorithm parameter. This method is not implemented.

Overrides:
engineGetParameter in class Signature

All Packages  Class Hierarchy  This Package  Previous  Next  Index