public class RSASession extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Cipher |
cipher |
protected static org.slf4j.Logger |
LOGGER |
protected int |
maxDecryptionBlockSize |
protected int |
maxEncryptionBlockSize |
| Constructor and Description |
|---|
RSASession() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(byte[] in) |
byte[] |
encrypt(byte[] in) |
void |
initializeForDecryption(PublicKey publicKey)
Prepare rsaCipher for decryption using received public key.
|
void |
initializeForEncryption(PrivateKey privateKey)
Prepare rsaCipher for encryption using local private key.
|
protected static org.slf4j.Logger LOGGER
protected Cipher cipher
protected int maxDecryptionBlockSize
protected int maxEncryptionBlockSize
public void initializeForEncryption(PrivateKey privateKey) throws NoSuchPaddingException, NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException
public void initializeForDecryption(PublicKey publicKey) throws NoSuchPaddingException, NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException
public byte[] encrypt(byte[] in)
throws IOException,
BadPaddingException,
IllegalBlockSizeException
public byte[] decrypt(byte[] in)
throws IOException,
BadPaddingException,
IllegalBlockSizeException
Copyright © 2011-2020 dCache.org. All Rights Reserved.