pkcs11module

package
v0.0.0-...-b2cdabd Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CKS_RO_PUBLIC_SESSION = iota
	CKS_RO_USER_FUNCTIONS
	CKS_RW_PUBLIC_SESSION
	CKS_RW_USER_FUNCTIONS
	CKS_RW_SO_FUNCTIONS
)

Variables

This section is empty.

Functions

func New

func New(certType string, configJSON json.RawMessage) (module certhandler.CertModule, err error)

New creates pkcs11 module instance.

Types

type PKCS11Module

type PKCS11Module struct {
	sync.Mutex
	// contains filtered or unexported fields
}

PKCS11Module PKCS11 certificate module.

func (*PKCS11Module) ApplyCertificate

func (module *PKCS11Module) ApplyCertificate(x509Certs []*x509.Certificate) (
	certInfo certhandler.CertInfo, password string, err error,
)

ApplyCertificate applies certificate.

func (*PKCS11Module) Clear

func (module *PKCS11Module) Clear() error

Clear clears security storage.

func (*PKCS11Module) Close

func (module *PKCS11Module) Close() (err error)

Close closes PKCS11 module.

func (*PKCS11Module) CreateKey

func (module *PKCS11Module) CreateKey(password, algorithm string) (key crypto.PrivateKey, err error)

CreateKey creates key pair.

func (*PKCS11Module) RemoveCertificate

func (module *PKCS11Module) RemoveCertificate(certURL, password string) error

RemoveCertificate removes certificate.

func (*PKCS11Module) RemoveKey

func (module *PKCS11Module) RemoveKey(keyURL, password string) error

RemoveKey removes key.

func (*PKCS11Module) SetOwner

func (module *PKCS11Module) SetOwner(password string) (err error)

SetOwner owns slot.

func (*PKCS11Module) ValidateCertificates

func (module *PKCS11Module) ValidateCertificates() (
	validInfos []certhandler.CertInfo, invalidCerts, invalidKeys []string, err error,
)

ValidateCertificates returns list of valid pairs, invalid certificates and invalid keys.

Jump to

Keyboard shortcuts

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