Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certificate listing with certutil #187

Closed
sosthene-nitrokey opened this issue Feb 1, 2024 · 1 comment
Closed

Certificate listing with certutil #187

sosthene-nitrokey opened this issue Feb 1, 2024 · 1 comment

Comments

@sosthene-nitrokey
Copy link
Contributor

To reproduce, from the folder of the repo:

  • Install NSS,
  • Create a certutil-db folder
  • Add to it:
    • pkcs11.txt:
name=NetHSM
library=path/to/repo/target/release/libnethsm_pkcs11.so
  • Run `certutil -N -d certutil-db
  • Run openssl req -nodes -x509 -days 1825 -newkey rsa:2048 -keyout test.key -out test.crt to generate a test certificate
  • Run openssl pkcs12 -export -out test.pk12 -inkey test.key -in test.crt -certfile test.crt to bundle the certificate and the private key
  • Run pk12util -i test.pk12 -d certutil-db -h LocalHSM -n test-cert to upload the certfiicate and private key bundle (this required setting the configuration enable_set_attribute_value to be set to true.
  • Run certutil -L -d certutil-db/ -h LocalHSM -> not certificate is listed
  • Run certutil -L -d certutil-db/ -h all -> the certificate is listed for some reason.
@sosthene-nitrokey
Copy link
Contributor Author

Fixed by #185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant