|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.fileutil.AESCrypter
public class AESCrypter
A password encryption scheme that uses either a 128-bit,192-bit or 256-bit AES
algorithm. To enable the 256-bit mode, you must install the JCE Unlimited
Strength policy files:
"Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files"
Nested Class Summary
static class
AESCrypter.KeySize
Field Summary
static AESCrypter.KeySize
AES128
static AESCrypter.KeySize
AES192
static AESCrypter.KeySize
AES256
Constructor Summary
AESCrypter()
AESCrypter(byte[] key)
AESCrypter(java.lang.String hexKey)
Method Summary
byte[]
decrypt(byte[] data)
java.lang.String
decrypt(java.lang.String str)
byte[]
encrypt(byte[] data)
java.lang.String
encrypt(java.lang.String str)
static byte[]
generateKeyFromPassphrase(java.lang.String passphrase,
AESCrypter.KeySize keySize)
AESCrypter.KeySize
getKeySize()
void
setKey(byte[] key)
void
setKey(java.lang.String hexKey)
void
setKeyFromPassphrase(java.lang.String passphrase)
boolean
setKeySize(AESCrypter.KeySize keySize)
Sets the key size, in number of bytes
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
AES256
public static final AESCrypter.KeySize AES256
AES192
public static final AESCrypter.KeySize AES192
AES128
public static final AESCrypter.KeySize AES128
Constructor Detail
AESCrypter
public AESCrypter()
AESCrypter
public AESCrypter(java.lang.String hexKey)
throws java.lang.Exception
java.lang.Exception
AESCrypter
public AESCrypter(byte[] key)
throws java.lang.Exception
java.lang.Exception
Method Detail
setKeySize
public boolean setKeySize(AESCrypter.KeySize keySize)
keySize
- either 16 or 32
getKeySize
public AESCrypter.KeySize getKeySize()
setKey
public void setKey(byte[] key)
throws java.lang.Exception
java.lang.Exception
setKey
public void setKey(java.lang.String hexKey)
throws java.lang.Exception
java.lang.Exception
setKeyFromPassphrase
public void setKeyFromPassphrase(java.lang.String passphrase)
throws java.lang.Exception
java.lang.Exception
generateKeyFromPassphrase
public static byte[] generateKeyFromPassphrase(java.lang.String passphrase,
AESCrypter.KeySize keySize)
encrypt
public java.lang.String encrypt(java.lang.String str)
throws java.lang.Exception
decrypt
public java.lang.String decrypt(java.lang.String str)
throws java.lang.Exception
encrypt
public byte[] encrypt(byte[] data)
throws java.lang.Exception
decrypt
public byte[] decrypt(byte[] data)
throws java.lang.Exception
Overview
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD