crypt

command
v0.1.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL