@Deprecated public class NiFiLegacyCipherProvider extends OpenSSLPKCS5CipherProvider implements PBECipherProvider
KeyDerivationFunction
(KDF) and should no longer be used.
It is provided only for backward-compatibility with legacy data. A strong KDF should be selected for any future use.Modifier and Type | Field and Description |
---|---|
private static DeprecationLogger |
deprecationLogger
Deprecated.
|
private static int |
ITERATION_COUNT
Deprecated.
|
private static org.slf4j.Logger |
logger
Deprecated.
|
Constructor and Description |
---|
NiFiLegacyCipherProvider()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
private int |
calculateSaltLength(EncryptionMethod encryptionMethod)
Deprecated.
|
byte[] |
generateSalt(EncryptionMethod encryptionMethod)
Deprecated.
|
Cipher |
getCipher(EncryptionMethod encryptionMethod,
String password,
byte[] salt,
int keyLength,
boolean encryptMode)
Deprecated.
Returns an initialized cipher for the specified algorithm.
|
protected int |
getIterationCount()
Deprecated.
|
byte[] |
readSalt(EncryptionMethod encryptionMethod,
InputStream in)
Deprecated.
Returns the salt provided as part of the cipher stream, or throws an exception if one cannot be detected.
|
byte[] |
readSalt(InputStream in)
Deprecated.
Returns the salt provided as part of the cipher stream, or throws an exception if one cannot be detected.
|
protected void |
validateSalt(EncryptionMethod encryptionMethod,
byte[] salt)
Deprecated.
|
void |
writeSalt(byte[] salt,
OutputStream out)
Deprecated.
Writes the salt provided as part of the cipher stream, or throws an exception if it cannot be written.
|
generateSalt, getCipher, getCipher, getDefaultSaltLength, getInitializedCipher
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generateSalt, getDefaultSaltLength
private static final org.slf4j.Logger logger
private static final DeprecationLogger deprecationLogger
private static final int ITERATION_COUNT
public Cipher getCipher(EncryptionMethod encryptionMethod, String password, byte[] salt, int keyLength, boolean encryptMode) throws Exception
MD5(password || salt) * 1000
].getCipher
in interface PBECipherProvider
getCipher
in class OpenSSLPKCS5CipherProvider
encryptionMethod
- the EncryptionMethod
password
- the secret inputsalt
- the saltkeyLength
- the desired key length in bits (ignored because OpenSSL ciphers provide key length in algorithm name)encryptMode
- true for encrypt, false for decryptException
- if there is a problem initializing the cipherpublic byte[] generateSalt(EncryptionMethod encryptionMethod)
protected void validateSalt(EncryptionMethod encryptionMethod, byte[] salt)
validateSalt
in class OpenSSLPKCS5CipherProvider
private int calculateSaltLength(EncryptionMethod encryptionMethod)
public byte[] readSalt(InputStream in) throws IOException, ProcessException
OpenSSLPKCS5CipherProvider
readSalt
in interface PBECipherProvider
readSalt
in class OpenSSLPKCS5CipherProvider
in
- the cipher InputStreamIOException
ProcessException
public byte[] readSalt(EncryptionMethod encryptionMethod, InputStream in) throws IOException
NiFiLegacyCipherProvider
because the legacy salt generation was dependent on the cipher block size.encryptionMethod
- the encryption methodin
- the cipher InputStreamIOException
public void writeSalt(byte[] salt, OutputStream out) throws IOException
PBECipherProvider
writeSalt
in interface PBECipherProvider
writeSalt
in class OpenSSLPKCS5CipherProvider
salt
- the saltout
- the cipher OutputStreamIOException
protected int getIterationCount()
getIterationCount
in class OpenSSLPKCS5CipherProvider
Copyright © 2023 Apache NiFi Project. All rights reserved.