|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.vocali.util.AESCrypt
public class AESCrypt
This class provides methods to encrypt and decrypt files using aescrypt file format, version 1 or 2.
Requires Java 6 and Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files.
Thread-safety and sharing: this class is not thread-safe.
AESCrypt objects can be used as Commands (create, use once and dispose),
or reused to perform multiple operations (not concurrently though).
Constructor Summary | |
---|---|
AESCrypt(boolean debug,
java.lang.String password)
Builds an object to encrypt or decrypt files with the given password. |
|
AESCrypt(java.lang.String password)
Builds an object to encrypt or decrypt files with the given password. |
Method Summary | |
---|---|
void |
decrypt(java.lang.String fromPath,
java.lang.String toPath)
The file at fromPath is decrypted and saved at toPath location. |
void |
encrypt(int version,
java.lang.String fromPath,
java.lang.String toPath)
The file at fromPath is encrypted and saved at toPath location. |
static void |
main(java.lang.String[] args)
|
void |
setPassword(java.lang.String password)
Changes the password this object uses to encrypt and decrypt. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AESCrypt(java.lang.String password) throws java.security.GeneralSecurityException, java.io.UnsupportedEncodingException
java.security.GeneralSecurityException
- if the platform does not support the required cryptographic methods.
java.io.UnsupportedEncodingException
- if UTF-16 encoding is not supported.public AESCrypt(boolean debug, java.lang.String password) throws java.security.GeneralSecurityException, java.io.UnsupportedEncodingException
java.security.GeneralSecurityException
- if the platform does not support the required cryptographic methods.
java.io.UnsupportedEncodingException
- if UTF-16 encoding is not supported.Method Detail |
---|
public void setPassword(java.lang.String password) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
- if UTF-16 encoding is not supported.public void encrypt(int version, java.lang.String fromPath, java.lang.String toPath) throws java.io.IOException, java.security.GeneralSecurityException
version can be either 1 or 2.
java.io.IOException
- when there are I/O errors.
java.security.GeneralSecurityException
- if the platform does not support the required cryptographic methods.public void decrypt(java.lang.String fromPath, java.lang.String toPath) throws java.io.IOException, java.security.GeneralSecurityException
Source file can be encrypted using version 1 or 2 of aescrypt.
java.io.IOException
- when there are I/O errors.
java.security.GeneralSecurityException
- if the platform does not support the required cryptographic methods.public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |