pkcs11key

package
v1.13.6 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

View Source
const (
	ReferenceScheme = "pkcs11:"
)

Variables

This section is empty.

Functions

func EncodeURIComponent

func EncodeURIComponent(uriString string, isForPath bool, usePercentEncoding bool) (string, error)

Types

type Key

type Key struct{}

func GetKeyWithURIConfig

func GetKeyWithURIConfig(config *Pkcs11UriConfig, askForPinIfNeeded bool) (*Key, error)

func (*Key) Certificate

func (k *Key) Certificate() (*x509.Certificate, error)

func (*Key) Close

func (k *Key) Close()

func (*Key) PublicKey

func (k *Key) PublicKey(opts ...signature.PublicKeyOption) (crypto.PublicKey, error)

func (*Key) Sign

func (k *Key) Sign(ctx context.Context, rawPayload []byte) ([]byte, []byte, error)

func (*Key) SignMessage

func (k *Key) SignMessage(message io.Reader, opts ...signature.SignOption) ([]byte, error)

func (*Key) SignerVerifier

func (k *Key) SignerVerifier() (signature.SignerVerifier, error)

func (*Key) Verifier

func (k *Key) Verifier() (signature.Verifier, error)

func (*Key) VerifySignature

func (k *Key) VerifySignature(signature, message io.Reader, opts ...signature.VerifyOption) error

type Pkcs11UriConfig

type Pkcs11UriConfig struct {
	ModulePath string
	SlotID     *int
	TokenLabel string
	KeyLabel   []byte
	KeyID      []byte
	Pin        string
	// contains filtered or unexported fields
}

func NewPkcs11UriConfig

func NewPkcs11UriConfig() *Pkcs11UriConfig

func NewPkcs11UriConfigFromInput

func NewPkcs11UriConfigFromInput(modulePath string, slotID *int, tokenLabel string, keyLabel []byte, keyID []byte, pin string) *Pkcs11UriConfig

func (*Pkcs11UriConfig) Construct

func (conf *Pkcs11UriConfig) Construct() (string, error)

func (*Pkcs11UriConfig) Parse

func (conf *Pkcs11UriConfig) Parse(uriString string) error

Jump to

Keyboard shortcuts

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