Java application - Secret key encryption

Greetings,

I’m providing a code snippet that’s used to encrypt some fields in a doc using a symmetric key which is present in the target ID.

This works on 6.5 and 7, but stopped working with 8 release.


Vector v = new Vector();

v.addElement(“SecretKey”);

doc.setEncryptionKeys(v);

certdoc.encrypt();


Calling encrypt generates an exception:

NotesException: Notes error: You don’t have any of the specified encryption keys

Anyone encountered this before/got any ideas?

Client side isn’t responsible for a lot with this API as all the magic happens serverside/under the covers.

Sounds like domino is unable to find the key named ‘SecretKey’ in the id of the user calling encrypt, but I’ve checked this countless times:

the ID has the keys and I’m able to use them through notes client but not through an app using NCSO.jar

Furthermore when the secret keys are generated the dates in the adjacent column seem to get their values corrupted, not sure if its a coincidence or related…

Subject: Java application - Secret key encryption

  • UPDATE *Plot thickens: wrote a lotusscript agent which calls encrypt on the target doc which I can call from java app, and encryption succeeds there.

Here is the real pickle: once LS encrypt succeeds and saves the doc, subsequent use of encrypt from java code suddenly starts working, ie. it makes the problem go away altogether!

Successfully replicated on 2 separate lnd8 servers.

So seems that the first successful encrypt changes something in the ID files or elsewhere in the system and the problem is gone.

Seems like i will have to use this braindead workaround of calling agent based encrypt once as I dont see any way out of it.

Yet Another Domino weirdness.

Any comments on that ?