|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.security.RSACrypto
public class RSACrypto
RSA encryption/decryption of data of any length. The pieces of data on which RSA can be normally operate are limited in size by the size of the RSA keys. To workaround that limitation this class implements a custom scheme, which uses RSA as a block cipher - the plaintext is divided into equally-sized blocks and each of them is RSA encrypted. This approach allows encryption/decyption over data of any length.
Constructor Summary | |
---|---|
RSACrypto(java.security.interfaces.RSAPublicKey publicKey,
java.security.interfaces.RSAPrivateKey privateKey,
java.security.Provider cryptoProvider)
Initialize the object with the specified parameters. |
Method Summary | |
---|---|
byte[] |
decrypt(byte[] encryptedData)
Decrypt data. |
byte[] |
encrypt(byte[] data)
Encrypt data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RSACrypto(java.security.interfaces.RSAPublicKey publicKey, java.security.interfaces.RSAPrivateKey privateKey, java.security.Provider cryptoProvider)
publicKey
- a RSA public keyprivateKey
- a RSA private keycryptoProvider
- a Java security providerMethod Detail |
---|
public byte[] encrypt(byte[] data) throws java.lang.Exception
encrypt
in interface Crypto
data
- plaintext
java.lang.Exception
- problem with encryptionpublic byte[] decrypt(byte[] encryptedData) throws java.lang.Exception
decrypt
in interface Crypto
encryptedData
- ciphertext
java.lang.Exception
- problem with decryption
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |