Package org.picketbox.util
Class EncryptionUtil
- java.lang.Object
-
- org.picketbox.util.EncryptionUtil
-
public class EncryptionUtil extends Object
Encryption/Decryption utility- Since:
- Aug 12, 2011
- Author:
- Anil.Saldhana@redhat.com
-
-
Constructor Summary
Constructors Constructor Description EncryptionUtil(String encryptionAlgorithm, int keySize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
decrypt(byte[] encryptedData, KeyPair keypair, SecretKey key)
byte[]
decrypt(byte[] encryptedData, KeyPair keypair, SecretKeySpec keySpec)
byte[]
decrypt(byte[] encryptedData, SecretKeySpec keySpec)
byte[]
encrypt(byte[] data, PublicKey publicKey, SecretKey key)
byte[]
encrypt(byte[] data, SecretKey key)
SecretKey
generateKey()
-
-
-
Constructor Detail
-
EncryptionUtil
public EncryptionUtil(String encryptionAlgorithm, int keySize)
-
-
Method Detail
-
generateKey
public SecretKey generateKey() throws NoSuchAlgorithmException
- Throws:
NoSuchAlgorithmException
-
encrypt
public byte[] encrypt(byte[] data, PublicKey publicKey, SecretKey key) throws Exception
- Throws:
Exception
-
decrypt
public byte[] decrypt(byte[] encryptedData, KeyPair keypair, SecretKeySpec keySpec) throws Exception
- Throws:
Exception
-
decrypt
public byte[] decrypt(byte[] encryptedData, KeyPair keypair, SecretKey key) throws Exception
- Throws:
Exception
-
decrypt
public byte[] decrypt(byte[] encryptedData, SecretKeySpec keySpec) throws Exception
- Throws:
Exception
-
-