|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.common.rolemap.DecryptRoleMapperFile
Stand-alone utility for converting an XML file with attributes of form
encryptedPassword="SOME PASSWORD"
so that the values
within the quotes are decrypted using a user-supplied encryption
password and the encryptedPassword
attribute has been
renamed to password
. This assumes that the XML file
was created using
uk.org.ogsadai.common.rolemap.EncryptRoleMapperFile
.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
|
private java.lang.String |
mFilename
|
private java.lang.String |
mPassword
|
Constructor Summary | |
DecryptRoleMapperFile(java.lang.String password,
java.lang.String filename)
Initialise the class with the encryption key and file name. |
Method Summary | |
java.lang.String |
decrypt()
Change all instances of an encryptedPpassword
attribute in the file's contents into a password
attribute, containing the decrypted version of the original
value, and return a string with all the changes in place. |
static void |
main(java.lang.String[] args)
Perform the decryption of the passwords in the file. |
void |
writeToFile(java.lang.String contents)
Delete the current file and replace it with a new one with the given contents. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private java.lang.String mFilename
private java.lang.String mPassword
Constructor Detail |
public DecryptRoleMapperFile(java.lang.String password, java.lang.String filename)
password
- The password to use as the encryption key.filename
- The path to the file.Method Detail |
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- An array containin the encryption key password and the path
to the file to decrypt.
java.lang.Exception
- if there's a problem decrypting the file.public void writeToFile(java.lang.String contents) throws java.lang.Exception
contents
- The new file content.
java.lang.Exception
- if there's a problem overwriting the file.public java.lang.String decrypt() throws java.lang.Exception
encryptedPpassword
attribute in the file's contents into a password
attribute, containing the decrypted version of the original
value, and return a string with all the changes in place.
java.lang.Exception
- if there's a problem.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |