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 StringPASSWORD_ENCRYPTED_PREFIXThe 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 Stringdecode(String encodedPassword)Stringdecode(String encodedPassword, boolean optionallyEncrypted)static StringdecryptPassword(String encrypted)Deprecated.protected StringdecryptPasswordInternal(String encrypted)static StringdecryptPasswordOptionallyEncrypted(String password)Deprecated.- Use the instance method through Encr instead of this directlyprotected StringdecryptPasswordOptionallyEncryptedInternal(String password)Decrypts a password if it contains the prefix "Encrypted "Stringencode(String rawPassword)Stringencode(String rawPassword, boolean includePrefix)static StringencryptPassword(String password)Deprecated.- use the instance method through Encr instead of this directlystatic StringencryptPasswordIfNotUsingVariables(String password)Deprecated.- Use the instance method through Encr instead of this directlyprotected StringencryptPasswordIfNotUsingVariablesInternal(String password)Encrypt the password, but only if the password doesn't contain any variables.protected StringencryptPasswordInternal(String password)String[]getPrefixes()protected StringgetSeed()voidinit()
-
-
-
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:
initin interfaceorg.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface- Throws:
org.pentaho.support.encryption.PasswordEncoderException
-
encode
public String encode(String rawPassword)
- Specified by:
encodein interfaceorg.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
-
encode
public String encode(String rawPassword, boolean includePrefix)
- Specified by:
encodein interfaceorg.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
-
decode
public String decode(String encodedPassword)
- Specified by:
decodein interfaceorg.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
-
decode
public String decode(String encodedPassword, boolean optionallyEncrypted)
- Specified by:
decodein interfaceorg.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
-
getSeed
protected String getSeed()
-
getPrefixes
public String[] getPrefixes()
- Specified by:
getPrefixesin 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
-
-