All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iaik.security.rsa.RSAKey

java.lang.Object
   |
   +----iaik.security.rsa.RSAKey

public abstract class RSAKey
extends Object
implements RSAKey
Class for dealing with PKCS#1 defined encryption blocks.


Constructor Index

 o RSAKey()

Method Index

 o crypt(BigInteger)
Uses the key to encrypt or decrypt a message.
 o crypt(byte[])
Uses the key from the subclass to encrypt or decrypt a message.
 o decrypt(int, byte[])
This method decrypts a RSA encrypted block and parses the result according to the in PKCS#1 defined encryption block.
 o encrypt(int, byte[])
This method creates a PKCS#1 defined encryption block and encrypts it with the key from the subclass.
 o getExponent()
Returns the exponent.
 o getModulus()
Returns the modulus.

Constructors

 o RSAKey
 public RSAKey()

Methods

 o crypt
 public abstract BigInteger crypt(BigInteger message)
Uses the key to encrypt or decrypt a message. Simply performs a modula exponentiation.

Parameters:
message - the message to en/decrypt as BigInteger
Returns:
the encrypted or decrypted message
 o crypt
 public byte[] crypt(byte message[])
Uses the key from the subclass to encrypt or decrypt a message. Simply performs a modula exponentiation.

Parameters:
message - the message to en/decrypt
Returns:
the encrypted or decrypted message
 o decrypt
 public byte[] decrypt(int blockType,
                       byte encrypted[]) throws SignatureException
This method decrypts a RSA encrypted block and parses the result according to the in PKCS#1 defined encryption block. Encryption block format: EB = BT|PS|00|D

Parameters:
blockType - the block type this block should have
encrypted - the data to be decrypted and parsed
Returns:
the data inside this block
Throws: SignatureException
if there is an error while parsing the block
 o encrypt
 public byte[] encrypt(int blockType,
                       byte data[]) throws SignatureException
This method creates a PKCS#1 defined encryption block and encrypts it with the key from the subclass. Encryption block format: EB = 00|BT|PS|00|D

Parameters:
blockType - the block type that should be created
data - the data to encrypt
Returns:
the created encryption block
Throws: SignatureException
if the block could not be created

All Packages  Class Hierarchy  This Package  Previous  Next  Index