public class Encryptor
extends java.lang.Object
| Constructor and Description |
|---|
Encryptor() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decrypt(byte[] data,
EncryptionKeyPair keyPair)
Decrypts the given data using the provided EncryptionKeyPair.
|
static byte[] |
encrypt(byte[] data,
EncryptionKeyPair keyPair)
Encrypts the given data using the provided EncryptionKeyPair.
|
public static byte[] decrypt(byte[] data,
EncryptionKeyPair keyPair)
throws javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException,
javax.crypto.NoSuchPaddingException,
java.security.NoSuchAlgorithmException,
java.security.InvalidAlgorithmParameterException,
java.security.InvalidKeyException
data - The encrypted data to be decryptedkeyPair - The EncryptionKeyPair containing the secret key and IV for decryptionjavax.crypto.IllegalBlockSizeExceptionjavax.crypto.BadPaddingExceptionjavax.crypto.NoSuchPaddingExceptionjava.security.NoSuchAlgorithmExceptionjava.security.InvalidAlgorithmParameterExceptionjava.security.InvalidKeyExceptionpublic static byte[] encrypt(byte[] data,
EncryptionKeyPair keyPair)
throws javax.crypto.NoSuchPaddingException,
java.security.NoSuchAlgorithmException,
java.security.InvalidAlgorithmParameterException,
java.security.InvalidKeyException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException
data - The data to be encryptedkeyPair - The EncryptionKeyPair containing the secret key and IV for encryptionjavax.crypto.NoSuchPaddingExceptionjava.security.NoSuchAlgorithmExceptionjava.security.InvalidAlgorithmParameterExceptionjava.security.InvalidKeyExceptionjavax.crypto.IllegalBlockSizeExceptionjavax.crypto.BadPaddingException