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.
-
ident
-
-
RSA()
-
-
decryptBlock(byte[], int, int, byte[], int)
- This method decrypts the specified array, placing the plain text
data into the destination array.
-
encrypt(BigInteger)
- Encrypt a data block.
-
encryptBlock(byte[], int, int, byte[], int)
- This method encrypts the specified array, placing the
ciphered data into the destination array.
-
engineGetBlockSize()
- Returns the block size.
-
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).
-
engineSetMode(String)
- Sets the mode of this cipher.
-
engineSetPadding(String)
- Sets the padding mechanism of this cipher.
-
setKey(Key)
-
ident
public static final String ident
RSA
public RSA()
setKey
protected void setKey(Key key) throws InvalidKeyException
- Overrides:
- setKey in class BlockCipher
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
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
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
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
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
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
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