public class KettleTwoWayPasswordEncoder extends Object implements TwoWayPasswordEncoderInterface
| Modifier and Type | Field and Description |
|---|---|
static String |
PASSWORD_ENCRYPTED_PREFIX
The word that is put before a password to indicate an encrypted form.
|
| Constructor and Description |
|---|
KettleTwoWayPasswordEncoder() |
| Modifier and Type | Method and Description |
|---|---|
String |
decode(String encodedPassword)
Decode a password which does NOT have a prefix attached.
|
String |
decode(String encodedPassword,
boolean optionallyEncrypted)
Decode a password.
|
static String |
decryptPassword(String encrypted) |
static String |
decryptPasswordOptionallyEncrypted(String password)
Decrypts a password if it contains the prefix "Encrypted "
|
String |
encode(String rawPassword)
Encode the raw password, include a prefix indicating the type of encryption used.
|
String |
encode(String rawPassword,
boolean includePrefix)
Encode a password.
|
static String |
encryptPassword(String password) |
static String |
encryptPasswordIfNotUsingVariables(String password)
Encrypt the password, but only if the password doesn't contain any variables.
|
String[] |
getPrefixes() |
void |
init()
Initialize the password encoder by loading key details from the environment (kettle.properties or system settings).
|
public static final String PASSWORD_ENCRYPTED_PREFIX
public void init()
throws KettleException
TwoWayPasswordEncoderInterfaceinit in interface TwoWayPasswordEncoderInterfaceKettleExceptionpublic String encode(String rawPassword)
TwoWayPasswordEncoderInterfaceencode in interface TwoWayPasswordEncoderInterfacerawPassword - The password to encodepublic String encode(String rawPassword, boolean includePrefix)
TwoWayPasswordEncoderInterfaceencode in interface TwoWayPasswordEncoderInterfacerawPassword - The password to encodeincludePrefix - True if a prefix needs to be encodedpublic String decode(String encodedPassword)
TwoWayPasswordEncoderInterfacedecode in interface TwoWayPasswordEncoderInterfaceencodedPassword - The encoded password without a prefixpublic String decode(String encodedPassword, boolean optionallyEncrypted)
TwoWayPasswordEncoderInterfacedecode in interface TwoWayPasswordEncoderInterfaceencodedPassword - The encoded password with or without a prefixoptionallyEncrypted - Set to true if the password is optionally encrypted (indicated by a prefix).public String[] getPrefixes()
getPrefixes in interface TwoWayPasswordEncoderInterfacepublic static final String encryptPasswordIfNotUsingVariables(String password)
password - The password to encryptpublic static final String decryptPasswordOptionallyEncrypted(String password)
password - The encrypted password