Documentation
¶
Overview ¶
Package main contains code demonstrating how to encrypt/decrypt with RSA key.
This demo assumes that you have a provisioned NetHSM with:
- an admin user named "admin"
- an operator user named "operator"
- both have the password "verysecret"
- there is a NetHSM instance running at https://127.0.0.1:8443/api/v1
To run this demo you can build it with:
go build
And then run it:
./crypt
The output should be something like this:
025/09/02 13:18:41 INFO created key keyName=rsaDemoKey1756811920899 2025/09/02 13:18:41 INFO testing RSA RAW, PKCS1 and OAEP encrypt/decrypt 2025/09/02 13:18:41 INFO RAW: round-trip OK 2025/09/02 13:18:41 INFO PKCS1: round-trip OK 2025/09/02 13:18:41 INFO OAEP-SHA256: round-trip OK 2025/09/02 13:18:41 INFO removed key keyName=rsaDemoKey1756811920899
Click to show internal directories.
Click to hide internal directories.