public class FileDecryptor extends AbstractFileDecryptor
FileDecryptor can decrypt files from the given crypt model bean.model| Constructor and Description |
|---|
FileDecryptor(de.alpharogroup.crypto.model.CryptModel<Cipher,String> model)
Instantiates a new
FileDecryptor. |
FileDecryptor(de.alpharogroup.crypto.model.CryptModel<Cipher,String> model,
File decryptedFile)
Instantiates a new file decryptor.
|
| Modifier and Type | Method and Description |
|---|---|
File |
decrypt(File encrypted) |
protected File |
newDecryptedFile(String parent,
String child)
Factory method for creating the new decrypted
File if it is not exists. |
newCipher, newCipher, newKeySpecnewOperationModenewAlgorithm, newAlgorithmParameterSpec, newCipher, newIterationCount, newSalt, newSecretKeyFactory, onInitializepublic FileDecryptor(de.alpharogroup.crypto.model.CryptModel<Cipher,String> model) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidAlgorithmParameterException, UnsupportedEncodingException
FileDecryptor.model - the modelInvalidKeyException - the invalid key exceptionNoSuchAlgorithmException - is thrown if instantiation of the SecretKeyFactory object fails.InvalidKeySpecException - is thrown if generation of the SecretKey object fails.NoSuchPaddingException - the no such padding exceptionInvalidAlgorithmParameterException - is thrown if initialization of the cypher object fails.UnsupportedEncodingException - is thrown if the named charset is not supported.public FileDecryptor(de.alpharogroup.crypto.model.CryptModel<Cipher,String> model, File decryptedFile) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidAlgorithmParameterException, UnsupportedEncodingException
model - the modeldecryptedFile - is the target of the result from the decryption, if null the default file will be
created. If null the name convention is given name of the encrypted file with the
extension '.decrypted'.InvalidKeyException - the invalid key exceptionNoSuchAlgorithmException - is thrown if instantiation of the SecretKeyFactory object fails.InvalidKeySpecException - is thrown if generation of the SecretKey object fails.NoSuchPaddingException - the no such padding exceptionInvalidAlgorithmParameterException - is thrown if initialization of the cypher object fails.UnsupportedEncodingException - is thrown if the named charset is not supported.protected File newDecryptedFile(String parent, String child)
File if it is not exists. This method
is invoked in the constructor from the derived classes and can be overridden so users can
provide their own version of creating the new decrypted Fileparent - the parent directorychild - the file nameFile objectCopyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.