lint

package
v0.0.0-...-30a5167 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(tbs, issuer *x509.Certificate, subjectPubKey crypto.PublicKey, realSigner crypto.Signer, skipLints []string) error

Check accomplishes the entire process of linting: it generates a throwaway signing key, uses that to create a throwaway cert, and runs a default set of lints (everything except for the ETSI and EV lints) against it. This is the primary public interface of this package, but it can be inefficient; creating a new signer and a new lint registry are expensive operations which performance-sensitive clients may want to cache.

func LintCert

func LintCert(lintCert *zlintx509.Certificate, lints lint.Registry) error

LintCert runs the given set of lints across the given cert and returns an error containing the names of all failed lints, or nil.

func MakeLintCert

func MakeLintCert(tbs, issuer *x509.Certificate, subjectPubKey crypto.PublicKey, lintSigner crypto.Signer) (*zlintx509.Certificate, error)

MakeLintCert creates a throwaway x509.Certificate which can be linted. Only use the result from MakeSigner as the final argument.

func MakeRegistry

func MakeRegistry(skipLints []string) (lint.Registry, error)

MakeRegistry creates a zlint Registry of lints to run, filtering out the EV- and ETSI-specific lints, as well as any others specified.

func MakeSigner

func MakeSigner(realSigner crypto.Signer) (crypto.Signer, error)

MakeSigner creates a throwaway crypto.Signer with the same key algorithm as the given Signer. This is useful if you intend to lint many certs are okay using the same throwaway key to sign all of them.

Types

type Linter

type Linter struct {
	// contains filtered or unexported fields
}

func NewLinter

func NewLinter(realSigner crypto.Signer, skipLints []string) (*Linter, error)

func (Linter) LintTBS

func (l Linter) LintTBS(tbs, issuer *x509.Certificate, subjectPubKey crypto.PublicKey) error

Jump to

Keyboard shortcuts

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