@InterfaceAudience.Private @InterfaceStability.Evolving public class AESEncryptor extends Object implements Encryptor
| Modifier and Type | Field and Description | 
|---|---|
| private Cipher | cipher | 
| private boolean | initialized | 
| private byte[] | iv | 
| private Key | key | 
| private SecureRandom | rng | 
| Constructor and Description | 
|---|
| AESEncryptor(Cipher cipher,
            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 | 
| (package private) Cipher | getCipher() | 
| byte[] | getIv()Get the initialization vector | 
| int | getIvLength()Get the expected length for the initialization vector | 
| protected void | init() | 
| 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 SecureRandom rng
private byte[] iv
private boolean initialized
public AESEncryptor(Cipher cipher, SecureRandom rng)
public int getIvLength()
EncryptorgetIvLength in interface Encryptorpublic int getBlockSize()
EncryptorgetBlockSize in interface Encryptorpublic byte[] getIv()
Encryptorpublic void setIv(byte[] iv)
Encryptorpublic OutputStream createEncryptionStream(OutputStream out)
EncryptorcreateEncryptionStream in interface Encryptorpublic void reset()
Encryptorprotected void init()
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.