Class au.net.aba.crypto.provider.RSA
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.
-
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)
- Re-key the cipher.
ident
public final static String ident
RSA
public RSA()
setKey
protected void setKey(Key key) throws InvalidKeyException
- Re-key the cipher.
- Overrides:
- setKey in class BlockCipher
engineSetMode
protected void engineSetMode(String mode) throws NoSuchAlgorithmException
- Sets the mode of this cipher. Only ECB is supported.
- 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
protected 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)
- 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)
- 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
All Packages Class Hierarchy This Package Previous Next Index