whitelist

package
v0.0.0-...-4d45f13 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Overview

Generated on 2018-05-29T09:11:15Z by adam, any modifications will be overwritten

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Whitelist

type Whitelist struct {
	// SHA256 fingerprints
	Fingerprints []string `json:"Fingerprints,omitempty" yaml:"fingerprints,omitempty"`

	// ISO 3166-1 two-letter country codes used to match
	// RFC 2253 Distinguished Names in certificates
	Countries []string `json:"Countries,omitempty" yaml:"countries,omitempty"`
}

Whitelist is the structure holding various `item` types that match against x509 certificates

func FromCertificates

func FromCertificates(certs []*x509.Certificate) Whitelist

FromCertificates returns a Whitelist with only the fingerprints of the passed certificates included.

func FromFile

func FromFile(path string) (Whitelist, error)

FromFile reads a whitelist file and parses it into items

func (Whitelist) Matches

func (w Whitelist) Matches(inc *x509.Certificate) bool

Matches checks a given x509 certificate against the criteria and returns if it's matched by an item in the whitelist

func (Whitelist) MatchesAll

func (w Whitelist) MatchesAll(cs []*x509.Certificate) bool

MatchesAll checks if a given list of certificates all match against a whitelist

func (Whitelist) ToFile

func (w Whitelist) ToFile(path string) error

ToFile take a Whitelist, encodes it in yaml and writes the result

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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