de.innovationgate.utils
RSAEncrypter
insteadpublic class RSAEncrypter extends java.lang.Object
Note: To be able to decrypt the data again the receiver of the encrypted data needs both the DES-ENCRYPTED DATA and the RSA-ENCRYPTED DES KEY!
Constructor and Description |
---|
RSAEncrypter()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
decrypt(java.lang.String data,
byte[] rsaPrivateKey,
byte[] desKeyEncryption)
Deprecated.
Decrypts the encrypted data string using the given RSA key (to decrypt the DES key) and the DES key (to decrypt the data itself).
|
void |
encrypt(byte[] data,
byte[] rsaPublicKey)
Deprecated.
Encrypt data by the given rsa key.
|
java.lang.String |
getData()
Deprecated.
Returns the DES-encrypted data after calling
encrypt(byte[], byte[]) |
byte[] |
getDesKeyEncryption()
Deprecated.
Returns the RSA-encrypted DES key after calling
encrypt(byte[], byte[]) |
public void encrypt(byte[] data, byte[] rsaPublicKey) throws java.security.GeneralSecurityException, java.io.UnsupportedEncodingException
getData()
. The RSA-encrypted DES key
used to encrypt the data can then be retrieved from getDesKeyEncryption()
.data
- The data to encryptrsaPublicKey
- The rsa public key used for encryptionjava.security.GeneralSecurityException
java.io.UnsupportedEncodingException
public byte[] decrypt(java.lang.String data, byte[] rsaPrivateKey, byte[] desKeyEncryption) throws java.security.GeneralSecurityException
data
- The data to decryptrsaPrivateKey
- The RSA key to decrypt the DES keydesKeyEncryption
- The RSA-encrypted DES key to decrypt the datajava.security.GeneralSecurityException
public java.lang.String getData()
encrypt(byte[], byte[])
public byte[] getDesKeyEncryption()
encrypt(byte[], byte[])