Looking for info about this error: The cryptographic key was not found

An Java agent running on one of our customer’s servers threw a NotesException with the error message “The cryptographic key was not found”. I have not encountered this error before. I don’t have a stack trace, so I don’t know the exact operation in the agent that threw this error. The agent processes mail messages, and I have requested access to the specific message that was being processed at the time that the error occurred, but that may take a while to arrange. In the meantime, I am trying to find out whatever I can about this error. A couple of old forum posts here and on some other sites allude to the error, but nobody seems to have come up with the actual root cause.

I found this error defined in bsafeerr.h.

#define ERR_BSAFE_KEY_NOT_FOUND (PKG_BSAFE+49)

errortext(ERR_BSAFE_KEY_NOT_FOUND, “The cryptographic key was not found”)

One thing I find interesting is that while this file contains errors related to all of the different parts of the Notes crypto security system, it looks like all of the errors defined near this particular one in the file have to do with reading data from ID files. That makes me suspect that the root cause of the error isn’t just related to a particular document that the agent is processing, but that the ID file of the server where the agent is running is somehow a factor, too.

Based on that, I’m wondering something. It’s natural to assume that an agent that processes mail messages is dealing only with public key encryption, but could this error actually be related to secret key encryption rather than public key encryption? I.e. does it occur when code attempts to read a named secret encryption key from an ID file that doesn’t contain that key?

-rich