000022941 - Cert-J/Crypto-J: How to debug/trace JSAFE_PKCS11Exception : Cryptographic hardware error

Document created by RSA Customer Support Employee on Jun 15, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000022941
Applies ToRSA BSAFE Cert-J
RSA BSAFE Crypto-J
IssueCert-J/Crypto-J: How to debug/trace JSAFE_PKCS11Exception : Cryptographic hardware error

JSAFE_PKCS11Exception : Cryptographic hardware error (or some other exception)

Cause JSAFE_PKCS11Exception is thrown whenever the status returned from the native C code is nonzero.
Resolution

To get more info, you could use the PKCS #11 trace library to log the calls to the PKCS #11 library. The PKCS #11 trace library can be obtained from RSA Developer Support.

1. Put the PKCS #11 trace library (e.g. p11trc.dll on Windows) in your system path (or the working directory on Windows).

2. Replace the library name in your application with the PKCS #11 trace library name, e.g.:

String libName = "p11trc.dll";

3. Rebuild your application.

4. Set these environment variables, e.g.:

set P11TRC_DRIVER=<name of the PKCS #11 library for the device>

set P11TRC_MECHANISM_FILE=mechanism_file.txt

set P11TRC_MECHANISM_OUTPUT=mechanism_output.txt

set P11TRC_OUTPUT=p11trc_output.txt

set P11TRC_TRACE_FILE=p11trc.txt

set P11_MECHANISM_LIST=RSA_PKCS

5. Run your application. A "p11trc.txt" file should be produced. The file should show which PKCS #11 functions are being called and their return values.

Legacy Article IDa34483

Attachments

    Outcomes