cynpkcs11

package module
v0.0.0-...-e28e1d4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: MIT Imports: 6 Imported by: 1

README

cynpkcs11

A thing that makes a crypto.Signer thing from PKCS#11 thing using miekg/pkcs11.

It is terrible, don't use it, I listened to awful christmas music while writing it.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Signer *Signer
	// contains filtered or unexported fields
}

Context represents a handle for a "session"

func New

func New(opts ContextOptions) (*Context, error)

New creates a signer and initializes it

func (*Context) Close

func (context *Context) Close()

Close cleans up the PKCS#11 objects

func (*Context) GetCertificates

func (context *Context) GetCertificates() ([]*x509.Certificate, error)

func (*Context) Initialize

func (context *Context) Initialize(opts ContextOptions) error

type ContextOptions

type ContextOptions struct {
	PKCS11Module string
	PIN          string
}

ContextOptions represents the options that are used to create and initialize the context

type Signer

type Signer struct {
	crypto.Signer
	// contains filtered or unexported fields
}

func (*Signer) Initialize

func (signer *Signer) Initialize() error

Initialize initializes all the things

func (*Signer) Public

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

func (*Signer) Sign

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

Jump to

Keyboard shortcuts

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