signer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pkcs11Config

type Pkcs11Config struct {
	Pkcs11ModulePath string
	Pin              string
	SlotNumber       uint
}

type Signer

type Signer interface {

	// SignBytes signs a message byte slice and returns the signature or an error.
	SignBytes(message []byte) ([]byte, error)

	// SignString signs a message string and returns the signature or an error.
	SignString(message string) ([]byte, error)

	// GetCerts retrieves the certificate chain as a slice of byte slices or an error.
	GetCerts() ([][]byte, error)

	// Public crypto.Signer interface compatible function, returns the public key associated with the signer for verification purposes.
	Public() crypto.PublicKey

	// Sign crypto.Signer interface compatible function, applies a cryptographic signature to the provided digest using the given random source and signing options.
	Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)

	// Close cleans up resources associated with the signer and returns an error if any.
	Close() error
}

Signer is an interface for cryptographic signing operations and certificate retrieval.

func NewPkcs11Signer

func NewPkcs11Signer(config Pkcs11Config) (Signer, error)

Jump to

Keyboard shortcuts

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