public class CryptoSymmetricEngine extends Object implements StreamingEncryptionEngine
| Constructor and Description |
|---|
CryptoSymmetricEngine(String cipherName,
byte[] key) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(byte[] input,
byte[] initVector)
Decrypts given input using given initialization vector (if needed)
|
InputStream |
decrypt(InputStream input,
byte[] initVector)
Decrypts given
InputStream and using given initialization vector (if needed). |
OutputStream |
decrypt(OutputStream output,
byte[] initVector)
Decrypts given
OutputStream and using given initialization vector (if needed). |
byte[] |
encrypt(byte[] input,
byte[] initVector)
Encrypts given input and using given initialization vector (if needed).
|
InputStream |
encrypt(InputStream input,
byte[] initVector)
Encrypts given
InputStream and using given initialization vector (if needed). |
OutputStream |
encrypt(OutputStream output,
byte[] initVector)
Encrypts given
OutputStream and using given initialization vector (if needed). |
public CryptoSymmetricEngine(String cipherName, byte[] key) throws EncryptionException
EncryptionExceptionpublic byte[] encrypt(byte[] input,
byte[] initVector)
throws EncryptionException
EncryptionEngineencrypt in interface EncryptionEngineinput - input to be encryptedinitVector - initialization vector for encryption if needed (can be null)EncryptionException - exception if encryption failspublic OutputStream encrypt(OutputStream output, byte[] initVector)
StreamingEncryptionEngineOutputStream and using given initialization vector (if needed).encrypt in interface StreamingEncryptionEngineoutput - OutputStream to be encryptedinitVector - initialization vector for encryption if needed (can be null)public OutputStream decrypt(OutputStream output, byte[] initVector) throws EncryptionException
StreamingEncryptionEngineOutputStream and using given initialization vector (if needed).decrypt in interface StreamingEncryptionEngineoutput - OutputStream to be decryptedinitVector - initialization vector for decryption if needed (can be null)EncryptionException - exception if decryption failspublic byte[] decrypt(byte[] input,
byte[] initVector)
EncryptionEnginedecrypt in interface EncryptionEngineinput - input to be decryptedinitVector - initialization vector for decryption if needed (can be null)public InputStream encrypt(InputStream input, byte[] initVector) throws EncryptionException
StreamingEncryptionEngineInputStream and using given initialization vector (if needed).encrypt in interface StreamingEncryptionEngineinput - InputStream to be encryptedinitVector - initialization vector for encryption if needed (can be null)EncryptionException - exception if encryption failspublic InputStream decrypt(InputStream input, byte[] initVector)
StreamingEncryptionEngineInputStream and using given initialization vector (if needed).decrypt in interface StreamingEncryptionEngineinput - InputStream to be decryptedinitVector - initialization vector for decryption if needed (can be null)Copyright © 2019. All rights reserved.