Here's the method to remove the encription from a NotesDocument object through LotusScript (details at the end of the message).
1- The user needs the encryption key to decrypt the document in the first time.
2- Modify the document (any field)
3- Save the doc
4- Remove all the $Seal items from the document
5- Save the document
Here's the function I used:
Function RemoveSeal(doc As NotesDocument)
doc.tmp_x = "1" 'Modify the doc
Call doc.Save(True,False) 'Save without encryption
While doc.HasItem("$Seal") 'Remove all the $Seal
Details of the solution:
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
1- A NotesDocument allways has to be encrypted (call doc.Encrypt) before saved to keep the document encrypted. If not, the document is saved with all its items decrypted.
2- A $Seal item is added to a NotesDocument each time the doc.Encrypt is called. The $Seal items are removed when the document is saved through the UI Document (Form). A document can then have many $Seal items.
3- Since the $Seal items IsEncrypted property = True, all the $Seal items are encrypted when you call the doc.Encrypt. And an other $Seal is added aferwards.
4- Since you need all the encryption keys for the $Seal items to open or save a document, you need to remove them all to get rid of the encryption. and since many of them are encrypted, you need to save the doc without encryption to see them all (and remove them).
5- You can then save the document without any encryption or add a new Encryption key if needed using the commands :
doc.EncryptionKeys = "MyKey"
N.B. Since I found almost NO DOCUMENTATION on any of this, I had to come up with my personal deductions and tests. So, if you have more accurate information on all of this, I would be glad to hear from you. Email me at firstname.lastname@example.org or email the editor@searchDomino.com and searchDomino will post your feedback here.