public abstract class KeyedCipherProvider extends Object implements CipherProvider
Modifier and Type | Field and Description |
---|---|
(package private) static byte[] |
IV_DELIMITER |
(package private) static int |
MAX_IV_LIMIT |
Constructor and Description |
---|
KeyedCipherProvider() |
Modifier and Type | Method and Description |
---|---|
(package private) abstract byte[] |
generateIV()
Generates a new random IV of the correct length.
|
abstract Cipher |
getCipher(EncryptionMethod encryptionMethod,
SecretKey key,
boolean encryptMode)
Returns an initialized cipher for the specified algorithm.
|
abstract Cipher |
getCipher(EncryptionMethod encryptionMethod,
SecretKey key,
byte[] iv,
boolean encryptMode)
Returns an initialized cipher for the specified algorithm.
|
byte[] |
readIV(InputStream in) |
void |
writeIV(byte[] iv,
OutputStream out) |
static final byte[] IV_DELIMITER
static final int MAX_IV_LIMIT
public abstract Cipher getCipher(EncryptionMethod encryptionMethod, SecretKey key, byte[] iv, boolean encryptMode) throws Exception
encryptionMethod
- the EncryptionMethod
key
- the keyiv
- the IV or nonceencryptMode
- true for encrypt, false for decryptException
- if there is a problem initializing the cipherpublic abstract Cipher getCipher(EncryptionMethod encryptionMethod, SecretKey key, boolean encryptMode) throws Exception
encryptionMethod
- the EncryptionMethod
key
- the keyencryptMode
- true for encrypt, false for decryptException
- if there is a problem initializing the cipher or if decryption is requestedabstract byte[] generateIV()
public byte[] readIV(InputStream in) throws IOException, ProcessException
IOException
ProcessException
public void writeIV(byte[] iv, OutputStream out) throws IOException
IOException
Copyright © 2018 Apache NiFi Project. All rights reserved.