Hi all!
I have a problem crypting data with hibernate,
I want to crypt username and password using hsm.
I supposed that I could do it automatically in Hibernate pojo Object through getter and setter methods... like:
public java.lang.String getUsername() {
return Crypt.getDecrypted(this.username);
}
public void setUsername(java.lang.String username){
this.username = Crypt.getEncrypted(username);
}
unfortunately when Hibernate sets data into db,
it pass by getter method calling getUsername(),
so the name is written into db decripted with no effects.
Do you know some trick to help me crypting and decrypting
data?
it will save me to do it manually every time the data is displayed.
Thanks a lot
|