public interface PBECipherProvider extends CipherProvider
Modifier and Type | Method and Description |
---|---|
byte[] |
generateSalt()
Returns a random salt suitable for this cipher provider.
|
Cipher |
getCipher(EncryptionMethod encryptionMethod,
String password,
byte[] salt,
int keyLength,
boolean encryptMode)
Returns an initialized cipher for the specified algorithm.
|
int |
getDefaultSaltLength()
Returns the default salt length for this implementation.
|
byte[] |
readSalt(InputStream in)
Returns the salt provided as part of the cipher stream, or throws an exception if one cannot be detected.
|
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.
|
Cipher getCipher(EncryptionMethod encryptionMethod, String password, byte[] salt, int keyLength, boolean encryptMode) throws Exception
Cipher.getIV()
.encryptionMethod
- the EncryptionMethod
password
- the secret inputsalt
- the saltkeyLength
- the desired key length in bitsencryptMode
- true for encrypt, false for decryptException
- if there is a problem initializing the cipherbyte[] generateSalt()
getDefaultSaltLength()
int getDefaultSaltLength()
byte[] readSalt(InputStream in) throws IOException
in
- the cipher InputStreamIOException
void writeSalt(byte[] salt, OutputStream out) throws IOException
salt
- the saltout
- the cipher OutputStreamIOException
Copyright © 2021 Apache NiFi Project. All rights reserved.