public class FileEncryptor extends AbstractFileEncryptor
FileEncryptor can encrypt files with the given crypt model.model| Constructor and Description |
|---|
FileEncryptor(de.alpharogroup.crypto.model.CryptModel<Cipher,String> model)
Instantiates a new file encryptor.
|
FileEncryptor(de.alpharogroup.crypto.model.CryptModel<Cipher,String> model,
File encryptedFile)
Instantiates a new file encryptor.
|
| Modifier and Type | Method and Description |
|---|---|
File |
encrypt(File toEncrypt) |
protected File |
newEncryptedFile(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 FileEncryptor(de.alpharogroup.crypto.model.CryptModel<Cipher,String> model) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidAlgorithmParameterException, UnsupportedEncodingException
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 FileEncryptor(de.alpharogroup.crypto.model.CryptModel<Cipher,String> model, File encryptedFile) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidAlgorithmParameterException, UnsupportedEncodingException
model - the modelencryptedFile - is the target of the result from the encryption, if null the default file will be
created. If null the name convention is given name of the file that has to be
encrypted with the extension '.enc'.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 newEncryptedFile(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.