|
|||||
FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgrails-app.domain.EncryptedData
class EncryptedData
Simple record-based storage for encrypted data. This was created with the intention of storing encrypted passwords, so there are some design decisions that were taken because of that:
It should be easy enough to modify to handle binary data.
Finally, see this bug report when dealing with domain classes with assigned ids: http://jira.codehaus.org/browse/GRAILS-1984
Field Summary | |
---|---|
static def |
constraints
|
java.lang.String |
dataItem
|
java.lang.String |
id
|
static def |
mapping
|
private java.lang.String |
tempData
|
private java.lang.String |
tempPassword
|
static def |
transients
|
Constructor Summary | |
EncryptedData()
|
Method Summary | |
---|---|
def
|
changePassword(java.lang.String oldPassword, java.lang.String newPassword)
Decrypts the current data item and re-encrypts it with a new password. |
java.lang.String
|
decrypt(java.lang.String thePassword)
Decrypts the currently stored data item. |
def
|
encrypt(java.lang.String theData, java.lang.String thePassword)
Encrypts a data item and stores it. |
def
|
getDecryptedData()
Getter for the decryptedData property. |
static EncryptedData
|
getOrCreate(def theId)
Attempts to load a record of EncryptedData with the id, and if it cannot find it then creates and returns an empty one. |
void
|
lockDown()
Forget all stored passwords and temporary information |
def
|
setDecryptedData(java.lang.String newData)
Sets the value for the decrypted data item and encrypts it. |
def
|
setPassword(java.lang.String newPassword)
Password setter. |
Methods inherited from class java.lang.Object | |
---|---|
hashCode, getClass, equals, toString, wait, wait, wait, notify, notifyAll |
Field Detail |
---|
public static def constraints
java.lang.String dataItem
java.lang.String id
public static def mapping
private java.lang.String tempData
private java.lang.String tempPassword
public static def transients
Constructor Detail |
---|
EncryptedData()
Method Detail |
---|
public def changePassword(java.lang.String oldPassword, java.lang.String newPassword)
public java.lang.String decrypt(java.lang.String thePassword)
public def encrypt(java.lang.String theData, java.lang.String thePassword)
public def getDecryptedData()
public static EncryptedData getOrCreate(def theId)
public void lockDown()
public def setDecryptedData(java.lang.String newData)
public def setPassword(java.lang.String newPassword)
Groovy Documentation