public abstract class RandomIVPBECipherProvider extends Object implements PBECipherProvider
| Modifier and Type | Field and Description |
|---|---|
(package private) static byte[] |
IV_DELIMITER |
(package private) static int |
MAX_IV_LIMIT |
(package private) static int |
MAX_SALT_LIMIT |
(package private) static byte[] |
SALT_DELIMITER |
| Constructor and Description |
|---|
RandomIVPBECipherProvider() |
| Modifier and Type | Method and Description |
|---|---|
(package private) abstract Cipher |
getCipher(EncryptionMethod encryptionMethod,
String password,
byte[] salt,
byte[] iv,
int keyLength,
boolean encryptMode)
Returns an initialized cipher for the specified algorithm.
|
(package private) abstract org.slf4j.Logger |
getLogger() |
byte[] |
readIV(InputStream in) |
byte[] |
readSalt(InputStream in)
Returns the salt provided as part of the cipher stream, or throws an exception if one cannot be detected.
|
void |
writeIV(byte[] iv,
OutputStream out) |
void |
writeSalt(byte[] salt,
OutputStream out)
Writes the salt provided as part of the cipher stream, or throws an exception if it cannot be written.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgenerateSalt, getCipher, getDefaultSaltLengthstatic final byte[] SALT_DELIMITER
static final int MAX_SALT_LIMIT
static final byte[] IV_DELIMITER
static final int MAX_IV_LIMIT
abstract Cipher getCipher(EncryptionMethod encryptionMethod, String password, byte[] salt, byte[] iv, int keyLength, boolean encryptMode) throws Exception
encryptionMethod - the EncryptionMethodpassword - the secret inputsalt - the saltiv - the IVkeyLength - the desired key length in bitsencryptMode - true for encrypt, false for decryptException - if there is a problem initializing the cipherabstract org.slf4j.Logger getLogger()
public byte[] readSalt(InputStream in) throws IOException, ProcessException
PBECipherProviderreadSalt in interface PBECipherProviderin - the cipher InputStreamIOExceptionProcessExceptionpublic void writeSalt(byte[] salt,
OutputStream out)
throws IOException
PBECipherProviderwriteSalt in interface PBECipherProvidersalt - the saltout - the cipher OutputStreamIOExceptionpublic byte[] readIV(InputStream in) throws IOException, ProcessException
IOExceptionProcessExceptionpublic void writeIV(byte[] iv,
OutputStream out)
throws IOException
IOExceptionCopyright © 2019 Apache NiFi Project. All rights reserved.