public class PasswordHandler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_KEY
key to use if none given
|
static java.lang.String |
DESEDE
use Triple-DES as algorithm
|
Constructor and Description |
---|
PasswordHandler()
Constructor for PasswordHandler, uses default key.
|
PasswordHandler(java.lang.String encryptKey)
Constructor for PasswordHandler
|
public static final java.lang.String DESEDE
public static final java.lang.String DEFAULT_KEY
public PasswordHandler() throws PasswordHandlerException
PasswordHandlerException
- Description of Exceptionpublic PasswordHandler(java.lang.String encryptKey) throws PasswordHandlerException
encryptKey
- String to use for a key, must be at
least 32 characters long.PasswordHandlerException
- Description of Exceptionpublic java.lang.String encrypt(java.lang.String password) throws PasswordHandlerException
password
- the password to encryptPasswordHandlerException
- Description of Exceptionpublic java.lang.String decrypt(java.lang.String encryptedPassword) throws PasswordHandlerException
encryptedPassword
- the encrypted password, needing to
be decryptedPasswordHandlerException
- Description of Exceptionpublic static void main(java.lang.String[] args)
args
- The command line arguments