public class PasswordManager extends Object
this.NUMBER_OF_ENCRYPT_KEYS attempts have been made.| Modifier and Type | Method and Description |
|---|---|
String |
decryptPassword(String encrypted)
Decrypt an encrypted password.
|
String |
encryptPassword(String plain)
Encrypt a password.
|
static PasswordManager |
getInstance()
Get an instance with no master password, which cannot encrypt or decrypt passwords.
|
static PasswordManager |
getInstance(org.apache.hadoop.fs.Path masterPwdLoc)
Get an instance.
|
static PasswordManager |
getInstance(Properties props)
Get an instance.
|
static PasswordManager |
getInstance(State state)
Get an instance.
|
static com.google.common.base.Optional<String> |
getMasterPassword(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path masterPasswordFile) |
static com.google.common.base.Optional<String> |
getMasterPassword(org.apache.hadoop.fs.Path masterPasswordFile) |
String |
readPassword(String password)
Decrypt a password if it is an encrypted password (in the form of ENC(.*))
and a master password file has been provided in the constructor.
|
public static PasswordManager getInstance()
public static PasswordManager getInstance(State state)
public static PasswordManager getInstance(Properties props)
public static PasswordManager getInstance(org.apache.hadoop.fs.Path masterPwdLoc)
public String encryptPassword(String plain)
plain - A plain password to be encrypted.public String decryptPassword(String encrypted)
encrypted - An encrypted password.public String readPassword(String password)
public static com.google.common.base.Optional<String> getMasterPassword(org.apache.hadoop.fs.Path masterPasswordFile)
public static com.google.common.base.Optional<String> getMasterPassword(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path masterPasswordFile)