signer

package
v0.0.0-...-0e64a8c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCertificate

func CreateCertificate(template, parent *x509.Certificate, pub, priv any) ([]byte, error)

CreateCertificate creates a certificate from an x509 template endorsing the provided pub key, with a signature generated using priv key. The provided parent certificate must endorse the public version of priv key.

The priv key must implement the crypto.Signer interface.

Types

type Params

type Params struct {
	Version                           int
	SerialNumber                      []byte
	Issuer, Subject, BasicConstraints pkix.Name
	NotBefore, NotAfter               time.Time
	KeyUsage                          x509.KeyUsage
	ExtKeyUsage                       []asn1.ObjectIdentifier
	BasicConstraintsValid             bool
	IsCA                              bool
	SignatureAlgorithm                x509.SignatureAlgorithm
	Extension                         []pkix.Extension
	AuthorityKeyId                    pkix.Extension
	SubjectAltName                    pkix.Extension
	IssuingCertificateURL             []string
}

Params contains parameters used to populate the certificate template at build time.

type Template

type Template interface {
	Build(*Params) (*x509.Certificate, error)
}

Template defines a certificate build interface.

Directories

Path Synopsis
Package tpm implements a TPM certificate template.
Package tpm implements a TPM certificate template.

Jump to

Keyboard shortcuts

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