@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, getInitializedCipherclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgenerateSalt, getDefaultSaltLengthprivate 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 PBECipherProvidergetCipher in class OpenSSLPKCS5CipherProviderencryptionMethod - the EncryptionMethodpassword - 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 OpenSSLPKCS5CipherProviderprivate int calculateSaltLength(EncryptionMethod encryptionMethod)
public byte[] readSalt(InputStream in) throws IOException, ProcessException
OpenSSLPKCS5CipherProviderreadSalt in interface PBECipherProviderreadSalt in class OpenSSLPKCS5CipherProviderin - the cipher InputStreamIOExceptionProcessExceptionpublic 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 InputStreamIOExceptionpublic void writeSalt(byte[] salt,
OutputStream out)
throws IOException
PBECipherProviderwriteSalt in interface PBECipherProviderwriteSalt in class OpenSSLPKCS5CipherProvidersalt - the saltout - the cipher OutputStreamIOExceptionprotected int getIterationCount()
getIterationCount in class OpenSSLPKCS5CipherProviderCopyright © 2022 Apache NiFi Project. All rights reserved.