Help us shape the future of Go! Take the 2026 Go Developer Survey

pkcs11

package module
v0.0.0-...-9483e72 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package pkcs11 provides a PKCS#11 (HSM/Token) signer for pdfsign.

NOTE: This package is provided on a "best-effort" basis. It demonstrates how to integrate hardware security modules with pdfsign but may not cover all PKCS#11 module variations or advanced features.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Signer

type Signer struct {
	ModulePath string
	TokenLabel string
	KeyLabel   string
	PIN        string
	PublicKey  crypto.PublicKey
}

Signer implements crypto.Signer using a PKCS#11 module (HSM/Token).

func NewSigner

func NewSigner(module, token, key, pin string, pub crypto.PublicKey) (*Signer, error)

NewSigner creates a new PKCS#11 signer.

func (*Signer) Public

func (s *Signer) Public() crypto.PublicKey

Public returns the public key.

func (*Signer) Sign

func (s *Signer) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)

Sign signs a digest using the PKCS#11 module.

Jump to

Keyboard shortcuts

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