@InterfaceAudience.Private @InterfaceStability.Evolving public class CommonsCryptoAESEncryptor extends Object implements Encryptor
Modifier and Type | Field and Description |
---|---|
private String |
cipherMode |
private boolean |
initialized |
private byte[] |
iv |
private Key |
key |
private Properties |
properties |
private SecureRandom |
rng |
Constructor and Description |
---|
CommonsCryptoAESEncryptor(String cipherMode,
Properties properties,
SecureRandom rng) |
Modifier and Type | Method and Description |
---|---|
OutputStream |
createEncryptionStream(OutputStream out)
Create a stream for encryption
|
int |
getBlockSize()
Get the cipher's internal block size
|
byte[] |
getIv()
Get the initialization vector
|
int |
getIvLength()
Get the expected length for the initialization vector
|
void |
reset()
Reset state, reinitialize with the key and iv
|
void |
setIv(byte[] iv)
Set the initialization vector
|
void |
setKey(Key key)
Set the secret key
|
private String cipherMode
private Properties properties
private byte[] iv
private boolean initialized
private SecureRandom rng
public CommonsCryptoAESEncryptor(String cipherMode, Properties properties, SecureRandom rng)
public int getIvLength()
Encryptor
getIvLength
in interface Encryptor
public int getBlockSize()
Encryptor
getBlockSize
in interface Encryptor
public byte[] getIv()
Encryptor
public void setIv(byte[] iv)
Encryptor
public OutputStream createEncryptionStream(OutputStream out)
Encryptor
createEncryptionStream
in interface Encryptor
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.