public abstract class RandomIVPBECipherProvider extends Object implements PBECipherProvider
Modifier and Type | Field and Description |
---|---|
static byte[] |
IV_DELIMITER |
(package private) static int |
MAX_IV_LIMIT |
(package private) static int |
MAX_SALT_LIMIT |
static byte[] |
SALT_DELIMITER |
Constructor and Description |
---|
RandomIVPBECipherProvider() |
Modifier and Type | Method and Description |
---|---|
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, wait
generateSalt, getCipher, getDefaultSaltLength
public static final byte[] SALT_DELIMITER
static final int MAX_SALT_LIMIT
public static final byte[] IV_DELIMITER
static final int MAX_IV_LIMIT
public abstract Cipher getCipher(EncryptionMethod encryptionMethod, String password, byte[] salt, byte[] iv, int keyLength, boolean encryptMode) throws Exception
encryptionMethod
- the EncryptionMethod
password
- 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
PBECipherProvider
readSalt
in interface PBECipherProvider
in
- the cipher InputStreamIOException
ProcessException
public void writeSalt(byte[] salt, OutputStream out) throws IOException
PBECipherProvider
writeSalt
in interface PBECipherProvider
salt
- the saltout
- the cipher OutputStreamIOException
public byte[] readIV(InputStream in) throws IOException, ProcessException
IOException
ProcessException
public void writeIV(byte[] iv, OutputStream out) throws IOException
IOException
Copyright © 2021 Apache NiFi Project. All rights reserved.