Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
crypto11
✓ github.com/ThalesIgnite/crypto11
Configures a PKCS#11 session and generates an RSA key pair.
package main
import (
"crypto/rand"
"fmt"
"github.com/ThalesIgnite/crypto11"
)
func main() {
config := &crypto11.Config{
Path: "/usr/lib/softhsm/libsofthsm2.so",
TokenLabel: "token",
Pin: "1234",
}
ctx, err := crypto11.Configure(config)
if err != nil {
fmt.Println(err)
return
}
defer ctx.Close()
key, err := ctx.GenerateRSAKeyPair(rand.Reader, 2048)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(key)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.6.1latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.