All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class au.net.aba.crypto.provider.RSA

java.lang.Object
   |
   +----javax.crypto.CipherSpi
           |
           +----au.net.aba.crypto.provider.BlockCipher
                   |
                   +----au.net.aba.crypto.provider.RSA

public class RSA
extends BlockCipher
A class that provides RSA public/private key encryption and decryption as specified in PKCS#1.

By default this cipher will use PKCS#1 padding however it also supports NoPadding.


Variable Index

 o ident

Constructor Index

 o RSA()

Method Index

 o decryptBlock(byte[], int, int, byte[], int)
This method decrypts the specified array, placing the plain text data into the destination array.
 o encrypt(BigInteger)
Encrypt a data block.
 o encryptBlock(byte[], int, int, byte[], int)
This method encrypts the specified array, placing the ciphered data into the destination array.
 o engineGetBlockSize()
Returns the block size.
 o engineGetOutputSize(int)
Returns the length in bytes that an output buffer would need to be in order to hold the result of the next update or doFinal operation, given the input length inputLen (in bytes).
 o engineSetMode(String)
Sets the mode of this cipher.
 o engineSetPadding(String)
Sets the padding mechanism of this cipher.
 o setKey(Key)

Variables

 o ident
 public static final String ident

Constructors

 o RSA
 public RSA()

Methods

 o setKey
 protected void setKey(Key key) throws InvalidKeyException
Overrides:
setKey in class BlockCipher
 o engineSetMode
 public void engineSetMode(String mode) throws NoSuchAlgorithmException
Sets the mode of this cipher.

Parameters:
mode - the mode of the cipher (ECB, CBC). Currently only ECB is supported.
Throws: NoSuchAlgorithmException
if the mode is not supported.
Overrides:
engineSetMode in class BlockCipher
 o engineSetPadding
 public void engineSetPadding(String padding) throws NoSuchPaddingException
Sets the padding mechanism of this cipher.

Parameters:
padding - the name of the type of padding to be applied, currently "PKCS1Padding", and "NoPadding" will be accepted.
Throws: NoSuchPaddingException
if the padding type is unknown.
Overrides:
engineSetPadding in class BlockCipher
 o engineGetBlockSize
 protected int engineGetBlockSize()
Returns the block size. In encryption mode this will be the size of the key less the header bytes, in decryption mode it will be the size of the key.

Overrides:
engineGetBlockSize in class BlockCipher
 o engineGetOutputSize
 protected int engineGetOutputSize(int inputLen)
Returns the length in bytes that an output buffer would need to be in order to hold the result of the next update or doFinal operation, given the input length inputLen (in bytes).

Overrides:
engineGetOutputSize in class BlockCipher
 o encryptBlock
 protected final int encryptBlock(byte src[],
                                  int srcIndex,
                                  int len,
                                  byte dst[],
                                  int dstIndex) throws IllegalBlockSizeException
This method encrypts the specified array, placing the ciphered data into the destination array.

Parameters:
src - The plain text.
srcIndex - The index from which to read.
len - The length of the plain text.
dst - The cipher text.
dstIndex - The index at which to write.
Returns:
The number of bytes processed.
Overrides:
encryptBlock in class BlockCipher
 o decryptBlock
 protected final int decryptBlock(byte src[],
                                  int srcIndex,
                                  int len,
                                  byte dst[],
                                  int dstIndex) throws BadPaddingException
This method decrypts the specified array, placing the plain text data into the destination array.

Parameters:
src - The cipher text.
srcIndex - The index from which to read.
len - The lenght of the cipher text.
dst - The plain text.
dstIndex - The index at which to write.
Returns:
The number of bytes of plaintext.
Overrides:
decryptBlock in class BlockCipher
 o encrypt
 protected BigInteger encrypt(BigInteger plainText)
Encrypt a data block.

Parameters:
plainText - The plain text block to encrypt.
Returns:
The encrypted data.

All Packages  Class Hierarchy  This Package  Previous  Next  Index