|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--uk.org.ogsadai.common.rolemap.Cryptography
A collection of methods related to encrypting and decrypting strings,
which can be used by the SimpleFileWithEncryptedPasswordsRoleMapper
to encrypt and decrypt database passwords.
| Constructor Summary | |
Cryptography()
|
|
| Method Summary | |
static java.lang.String |
getPassword()
Returns the value of the ogsadai.password system
property, or throws an exception if it is not set. |
static java.lang.String |
scramble(java.lang.String password,
byte[] plainText)
Encrypts an array of bytes, using a given password, and returns the encrypted bytes as a Base-64 encoded string. |
static java.lang.String |
scramble(java.lang.String password,
java.lang.String plainText)
Encrypts a string, using a given password, and returns the encrypted text as a Base-64 encoded string. |
static java.lang.String |
unscramble(java.lang.String scrambled)
Unencrypts a Base-64 encoded string, using the value of the ogsadai.password system property as a password,
and returns the unencrypted string. |
static java.lang.String |
unscramble(java.lang.String password,
byte[] scrambled)
Unencrypts an array of Base-64 encoded bytes, using a given password, and returns the unencrypted bytes as a string. |
static java.lang.String |
unscramble(java.lang.String password,
java.lang.String scrambled)
Unencrypts a Base-64 encoded string, using a given password, and returns the unencrypted string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Cryptography()
| Method Detail |
public static java.lang.String getPassword()
throws CommonUserException
ogsadai.password system
property, or throws an exception if it is not set.
CommonSystemException - if the property is not set
CommonUserException
public static java.lang.String scramble(java.lang.String password,
byte[] plainText)
throws CommonSystemException
password - the password to use as a keyplainText - the bytes to encrypt
CommonSystemException - if a problem occurred
public static java.lang.String scramble(java.lang.String password,
java.lang.String plainText)
throws CommonSystemException
password - the password to use as a keyplainText - the string to encrypt
CommonSystemException - if a problem occurred
public static java.lang.String unscramble(java.lang.String password,
byte[] scrambled)
throws CommonSystemException
password - the password to use as a keyscrambled - the bytes to Base-64 decode and decrypt
CommonSystemException - if a problem occurred
public static java.lang.String unscramble(java.lang.String password,
java.lang.String scrambled)
throws CommonSystemException
password - the password to use as a keyscrambled - the string to Base-64 decode and decrypt
CommonSystemException - if a problem occurred
public static java.lang.String unscramble(java.lang.String scrambled)
throws CommonSystemException,
CommonUserException
ogsadai.password system property as a password,
and returns the unencrypted string.
scrambled - the string to Base-64 decode and decrypt
CommonSystemException - if a problem occurred
CommonUserException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||