Package org.gatein.portal.encoder
Class PBEUtils
java.lang.Object
org.gatein.portal.encoder.PBEUtils
Utility dealing with Password Based Encryption
(Code is ripped off of the PBEUtils class in JBossSecurity/PicketBox)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]decode(byte[] secret, String cipherAlgorithm, SecretKey cipherKey, PBEParameterSpec cipherSpec) static Stringdecode64(String secret, String cipherAlgorithm, SecretKey cipherKey, PBEParameterSpec cipherSpec) static byte[]encode(byte[] secret, String cipherAlgorithm, SecretKey cipherKey, PBEParameterSpec cipherSpec) static Stringencode64(byte[] secret, String cipherAlgorithm, SecretKey cipherKey, PBEParameterSpec cipherSpec) static void
-
Constructor Details
-
PBEUtils
public PBEUtils()
-
-
Method Details
-
encode
public static byte[] encode(byte[] secret, String cipherAlgorithm, SecretKey cipherKey, PBEParameterSpec cipherSpec) throws Exception - Throws:
Exception
-
encode64
public static String encode64(byte[] secret, String cipherAlgorithm, SecretKey cipherKey, PBEParameterSpec cipherSpec) throws Exception - Throws:
Exception
-
decode
public static byte[] decode(byte[] secret, String cipherAlgorithm, SecretKey cipherKey, PBEParameterSpec cipherSpec) throws GeneralSecurityException - Throws:
GeneralSecurityException
-
decode64
public static String decode64(String secret, String cipherAlgorithm, SecretKey cipherKey, PBEParameterSpec cipherSpec) throws GeneralSecurityException, UnsupportedEncodingException -
main
- Throws:
Exception
-