|
Hi ,
I am trying to utilize MS SQL DB level encryption to encrypt a field . I am trying to find how we can call DB encrypt function through hibernate. I reached half way .
1 .It appears that @columntransformers annotation can be used to apply any kind of transformations.
2. For the DB encrypt funtion EncryptByKey we need to pass a symmetric key . And we need to open the key before we can execute the function.
I could not find a way to open the symmetric key through hibernate. I have attached a link where the same question is asked.
OPEN SYMMETRIC KEY CreditCards_Key11 DECRYPTION BY CERTIFICATE Sales09;
– Encrypt the value in column CardNumber with symmetric – key CreditCards_Key11. – Save the result in column CardNumber_Encrypted. UPDATE Sales.CreditCard SET CardNumber_Encrypted = EncryptByKey(Key_GUID('CreditCards_Key11'), CardNumber, 1, CONVERT( varbinary, CreditCardID) );
http://msdn.microsoft.com/en-us/library/ms174361.aspx https://forum.hibernate.org/viewtopic.php?f=9&t=961090&view=next
|