Package org.pentaho.di.core.encryption
Class KettleTwoWayPasswordEncoder
- java.lang.Object
-
- org.pentaho.di.core.encryption.KettleTwoWayPasswordEncoder
-
- All Implemented Interfaces:
org.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
public class KettleTwoWayPasswordEncoder extends Object implements org.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
This class handles basic encryption of passwords in Kettle. Note that it's not really encryption, it's more obfuscation. Passwords are difficult to read, not impossible.- Since:
- 17-12-2003
- Author:
- Matt
-
-
Field Summary
Fields Modifier and Type Field Description static String
PASSWORD_ENCRYPTED_PREFIX
The word that is put before a password to indicate an encrypted form.
-
Constructor Summary
Constructors Constructor Description KettleTwoWayPasswordEncoder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
decode(String encodedPassword)
String
decode(String encodedPassword, boolean optionallyEncrypted)
static String
decryptPassword(String encrypted)
Deprecated.protected String
decryptPasswordInternal(String encrypted)
static String
decryptPasswordOptionallyEncrypted(String password)
Deprecated.- Use the instance method through Encr instead of this directlyprotected String
decryptPasswordOptionallyEncryptedInternal(String password)
Decrypts a password if it contains the prefix "Encrypted "String
encode(String rawPassword)
String
encode(String rawPassword, boolean includePrefix)
static String
encryptPassword(String password)
Deprecated.- use the instance method through Encr instead of this directlystatic String
encryptPasswordIfNotUsingVariables(String password)
Deprecated.- Use the instance method through Encr instead of this directlyprotected String
encryptPasswordIfNotUsingVariablesInternal(String password)
Encrypt the password, but only if the password doesn't contain any variables.protected String
encryptPasswordInternal(String password)
String[]
getPrefixes()
protected String
getSeed()
void
init()
-
-
-
Field Detail
-
PASSWORD_ENCRYPTED_PREFIX
public static final String PASSWORD_ENCRYPTED_PREFIX
The word that is put before a password to indicate an encrypted form. If this word is not present, the password is considered to be NOT encrypted- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init() throws org.pentaho.support.encryption.PasswordEncoderException
- Specified by:
init
in interfaceorg.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
- Throws:
org.pentaho.support.encryption.PasswordEncoderException
-
encode
public String encode(String rawPassword)
- Specified by:
encode
in interfaceorg.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
-
encode
public String encode(String rawPassword, boolean includePrefix)
- Specified by:
encode
in interfaceorg.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
-
decode
public String decode(String encodedPassword)
- Specified by:
decode
in interfaceorg.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
-
decode
public String decode(String encodedPassword, boolean optionallyEncrypted)
- Specified by:
decode
in interfaceorg.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
-
getSeed
protected String getSeed()
-
getPrefixes
public String[] getPrefixes()
- Specified by:
getPrefixes
in interfaceorg.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
-
encryptPasswordIfNotUsingVariablesInternal
protected final String encryptPasswordIfNotUsingVariablesInternal(String password)
Encrypt the password, but only if the password doesn't contain any variables.- Parameters:
password
- The password to encrypt- Returns:
- The encrypted password or the
-
decryptPasswordOptionallyEncryptedInternal
protected final String decryptPasswordOptionallyEncryptedInternal(String password)
Decrypts a password if it contains the prefix "Encrypted "- Parameters:
password
- The encrypted password- Returns:
- The decrypted password or the original value if the password doesn't start with "Encrypted "
-
encryptPasswordIfNotUsingVariables
public static final String encryptPasswordIfNotUsingVariables(String password)
Deprecated.- Use the instance method through Encr instead of this directlyEncrypt the password, but only if the password doesn't contain any variables.- Parameters:
password
- The password to encrypt- Returns:
- The encrypted password or the
-
decryptPasswordOptionallyEncrypted
public static final String decryptPasswordOptionallyEncrypted(String password)
Deprecated.- Use the instance method through Encr instead of this directlyDecrypts a password if it contains the prefix "Encrypted "- Parameters:
password
- The encrypted password- Returns:
- The decrypted password or the original value if the password doesn't start with "Encrypted "
-
encryptPassword
public static final String encryptPassword(String password)
Deprecated.- use the instance method through Encr instead of this directlyDeprecared - use the instance method instead- Parameters:
password
-- Returns:
- encrypted password
-
-