constraints

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstraintError

type ConstraintError struct {
	Type   string
	Name   string
	Detail string
}

ConstraintError is the typed error that will be returned if a constraint error is found.

func (ConstraintError) As

func (e ConstraintError) As(v any) bool

As implements the As(any) bool interface and allows to use "errors.As()" to convert the ConstraintError to an errs.Error.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

type Engine

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

Engine implements a constraint validator for DNS names, IP addresses, Email addresses and URIs.

func New

func New(chain ...*x509.Certificate) *Engine

New creates a constraint validation engine that contains the given chain of certificates.

func (*Engine) Validate

func (e *Engine) Validate(dnsNames []string, ipAddresses []net.IP, emailAddresses []string, uris []*url.URL) error

Validate checks the given names with the name constraints defined in the service.

func (*Engine) ValidateCertificate

func (e *Engine) ValidateCertificate(cert *x509.Certificate) error

ValidateCertificate validates the DNS names, IP addresses, Email addresses and URIs present in the given certificate.

Jump to

Keyboard shortcuts

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