pkcs11

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvPin       = "PKCS11_PIN"
	EnvLabel     = "PKCS11_LABEL"
	DefaultPin   = "98765432"
	DefaultLabel = "ForFSC"

	Provider = "PKCS11"
)

Variables

This section is empty.

Functions

func CheckToken

func CheckToken(opts *config.PKCS11) error

CheckToken checks whether a token is available that matches the given label. If the token does not exist, it is created.

func DERToPublicKey

func DERToPublicKey(raw []byte) (pub interface{}, err error)

DERToPublicKey unmarshals a der to public key

func FindPKCS11Lib

func FindPKCS11Lib() (lib, pin, label string, err error)

FindPKCS11Lib attempts to find the PKCS11 library based on the given configuration

func GeneratePrivateKey

func GeneratePrivateKey() (*ecdsa.PublicKey, error)

GeneratePrivateKey creates a private key in the HSM and returns its corresponding public key

func GetBCCSP

func GetBCCSP(conf *config.BCCSP) (bccsp.BCCSP, bccsp.KeyStore, error)

GetBCCSP returns a new instance of the HSM-based BCCSP

func ListTokens

func ListTokens(opts *config.PKCS11) ([]pkcs11lib.TokenInfo, error)

ListTokens lists available tokens

func ToPKCS11Opts

func ToPKCS11Opts(o *config.PKCS11) *pkcs11.PKCS11Opts

Types

This section is empty.

Jump to

Keyboard shortcuts

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