pkix

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCertificateValidation = errors.New("certificate validation error")
	ErrMissingKeyUsage       = errors.New("missing key usage")
)

Functions

func KeyUsageToString

func KeyUsageToString(usage x509.KeyUsage) string

func ReadPEM

func ReadPEM(pemBytes []byte, callback PEMBlockCallback) error

func SubjectKeyID

func SubjectKeyID(pubKey any) ([]byte, error)

func ValidateCertificate

func ValidateCertificate(cert *x509.Certificate, opts ...ValidationOption) error

Types

type PEMBlockCallback

type PEMBlockCallback func(idx int, blockType string, headers map[string]string, content []byte) error

type ValidationOption

type ValidationOption func(opts *options) error

func WithCurrentTime

func WithCurrentTime(time time.Time) ValidationOption

func WithDNSName

func WithDNSName(dnsName string) ValidationOption

func WithExtendedKeyUsage

func WithExtendedKeyUsage(usage x509.ExtKeyUsage) ValidationOption

func WithIntermediateCACertificates

func WithIntermediateCACertificates(certs []*x509.Certificate) ValidationOption

func WithKeyUsage

func WithKeyUsage(usage x509.KeyUsage) ValidationOption

func WithRootCACertificates

func WithRootCACertificates(certs []*x509.Certificate) ValidationOption

func WithSystemTrustStore

func WithSystemTrustStore() ValidationOption

Jump to

Keyboard shortcuts

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