org.polyglotted.crypto.symmetric
Class AesEncrypter
java.lang.Object
org.polyglotted.crypto.api.AbstractCrypto
org.polyglotted.crypto.symmetric.AesEncrypter
- All Implemented Interfaces:
- Crypto
public class AesEncrypter
- extends AbstractCrypto
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AesEncrypter
public AesEncrypter(String passPhrase)
- Create a new AesEncrypter
- Parameters:
passPhrase - the Passphrase for the secret keysalt - the salt for the secret key
getMode
public AbstractCrypto.Mode getMode()
- Specified by:
getMode in class AbstractCrypto
- Returns:
- if this crypto performs an encrypt or decrypt operation
crypt
public String crypt(String text)
- Description copied from interface:
Crypto
- Perform encrypt or decrypt action
- Parameters:
text - the String to crypt
- Returns:
- the result String
encrypt
public static String encrypt(String passPhrase,
String text)
- Utility method to encrypt any password protected data
- Parameters:
passPhrase - the password to encrypt withtext - the text to be encrypted
- Returns:
- the encrypted String
encryptPropertyFile
public static void encryptPropertyFile(String passPhrase,
InputStream propertyIs,
OutputStream output,
String prefix)
- Encrypt the incoming property file and copy the resulting data into the output stream.
- Parameters:
passPhrase - the password to encrypt withpropertyIs - the property file input streamoutput - the output stream to write the encrypted valuesprefix - the String prefix for lines which have to be encrypted
Copyright © 2012-2013 Polyglotted Org. All Rights Reserved.