org.polyglotted.crypto.symmetric
Class AesDecrypter
java.lang.Object
org.polyglotted.crypto.api.AbstractCrypto
org.polyglotted.crypto.symmetric.AesDecrypter
- All Implemented Interfaces:
- Crypto
public class AesDecrypter
- extends AbstractCrypto
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AesDecrypter
public AesDecrypter(String passPhrase)
- Create a new AesDecrypter. This method does not initialize the cipher and cannot be used for encrypting without
initializing it first
- Parameters:
passPhrase - the Passphrase for the secret key
AesDecrypter
public AesDecrypter(String passPhrase,
byte[] iv)
- Create a new AesDecrypter
- 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 cipherText)
- Description copied from interface:
Crypto
- Perform encrypt or decrypt action
- Parameters:
cipherText - the String to crypt
- Returns:
- the result String
decrypt
public static String decrypt(String passPhrase,
String cipherText)
- Decrypt the given text with a private key
- Parameters:
passPhrase - the password to decrypt withinput - the cipher data to be decryted
- Returns:
- the String containing plain text
decryptPropertyFile
public static void decryptPropertyFile(String passPhrase,
InputStream propertyIs,
OutputStream output,
String prefix)
- Decrypt the incoming property file and copy the resulting data into the output stream.
- Parameters:
passPhrase - the password to decrypt withpropertyIs - the property file input streamoutput - the output stream to write the decrypted valuesprefix - the String prefix for lines which have to be decryted
Copyright © 2012-2013 Polyglotted Org. All Rights Reserved.