operator

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ToFloat64 added in v1.1.1

func ToFloat64(v any) (float64, bool)

func ToInt added in v1.1.1

func ToInt(v any) (int, bool)

Types

type AKIMatchesSKI

type AKIMatchesSKI struct{}

func (AKIMatchesSKI) Evaluate

func (AKIMatchesSKI) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (AKIMatchesSKI) Name

func (AKIMatchesSKI) Name() string

type Absent

type Absent struct{}

func (Absent) Evaluate

func (Absent) Evaluate(n *node.Node, _ *EvaluationContext, _ []any) (bool, error)

func (Absent) Name

func (Absent) Name() string

type After

type After struct{}

func (After) Evaluate

func (After) Evaluate(n *node.Node, ctx *EvaluationContext, operands []any) (bool, error)

func (After) Name

func (After) Name() string

type Before

type Before struct{}

func (Before) Evaluate

func (Before) Evaluate(n *node.Node, ctx *EvaluationContext, operands []any) (bool, error)

func (Before) Name

func (Before) Name() string

type CRLNotExpired

type CRLNotExpired struct{}

func (CRLNotExpired) Evaluate

func (CRLNotExpired) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (CRLNotExpired) Name

func (CRLNotExpired) Name() string

type CRLSignedBy

type CRLSignedBy struct{}

func (CRLSignedBy) Evaluate

func (CRLSignedBy) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (CRLSignedBy) Name

func (CRLSignedBy) Name() string

type CRLValid

type CRLValid struct{}

func (CRLValid) Evaluate

func (CRLValid) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (CRLValid) Name

func (CRLValid) Name() string

type CertificatePolicyValid

type CertificatePolicyValid struct{}

func (CertificatePolicyValid) Evaluate

func (CertificatePolicyValid) Evaluate(_ *node.Node, ctx *EvaluationContext, operands []any) (bool, error)

func (CertificatePolicyValid) Name

type Contains

type Contains struct{}

func (Contains) Evaluate

func (Contains) Evaluate(n *node.Node, _ *EvaluationContext, operands []any) (bool, error)

func (Contains) Name

func (Contains) Name() string

type ContextOption

type ContextOption func(*EvaluationContext)

func WithCRLs

func WithCRLs(crls []*crl.Info) ContextOption

func WithOCSPs

func WithOCSPs(ocsps []*ocsp.Info) ContextOption

type EKUClientAuth

type EKUClientAuth struct{}

func (EKUClientAuth) Evaluate

func (EKUClientAuth) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (EKUClientAuth) Name

func (EKUClientAuth) Name() string

type EKUContains

type EKUContains struct{}

func (EKUContains) Evaluate

func (EKUContains) Evaluate(_ *node.Node, ctx *EvaluationContext, operands []any) (bool, error)

func (EKUContains) Name

func (EKUContains) Name() string

type EKUNotContains

type EKUNotContains struct{}

func (EKUNotContains) Evaluate

func (EKUNotContains) Evaluate(_ *node.Node, ctx *EvaluationContext, operands []any) (bool, error)

func (EKUNotContains) Name

func (EKUNotContains) Name() string

type EKUServerAuth

type EKUServerAuth struct{}

func (EKUServerAuth) Evaluate

func (EKUServerAuth) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (EKUServerAuth) Name

func (EKUServerAuth) Name() string

type Eq

type Eq struct{}

func (Eq) Evaluate

func (Eq) Evaluate(n *node.Node, _ *EvaluationContext, operands []any) (bool, error)

func (Eq) Name

func (Eq) Name() string

type EvaluationContext

type EvaluationContext struct {
	Root  *node.Node
	Now   time.Time
	Cert  *cert.Info
	Chain []*cert.Info
	CRLs  []*crl.Info
	OCSPs []*ocsp.Info
}

func NewEvaluationContext

func NewEvaluationContext(root *node.Node, c *cert.Info, chain []*cert.Info, opts ...ContextOption) *EvaluationContext

func (*EvaluationContext) HasCRLs added in v1.1.1

func (ctx *EvaluationContext) HasCRLs() bool

func (*EvaluationContext) HasCert added in v1.1.1

func (ctx *EvaluationContext) HasCert() bool

func (*EvaluationContext) HasChain added in v1.1.1

func (ctx *EvaluationContext) HasChain() bool

func (*EvaluationContext) HasOCSPs added in v1.1.1

func (ctx *EvaluationContext) HasOCSPs() bool

type Gt

type Gt struct{}

func (Gt) Evaluate

func (Gt) Evaluate(n *node.Node, ctx *EvaluationContext, operands []any) (bool, error)

func (Gt) Name

func (Gt) Name() string

type Gte

type Gte struct{}

func (Gte) Evaluate

func (Gte) Evaluate(n *node.Node, ctx *EvaluationContext, operands []any) (bool, error)

func (Gte) Name

func (Gte) Name() string

type In

type In struct{}

func (In) Evaluate

func (In) Evaluate(n *node.Node, _ *EvaluationContext, operands []any) (bool, error)

func (In) Name

func (In) Name() string

type IsCritical

type IsCritical struct{}

func (IsCritical) Evaluate

func (IsCritical) Evaluate(n *node.Node, _ *EvaluationContext, _ []any) (bool, error)

func (IsCritical) Name

func (IsCritical) Name() string

type IsEmpty

type IsEmpty struct{}

func (IsEmpty) Evaluate

func (IsEmpty) Evaluate(n *node.Node, _ *EvaluationContext, _ []any) (bool, error)

func (IsEmpty) Name

func (IsEmpty) Name() string

type IssuedBy

type IssuedBy struct{}

func (IssuedBy) Evaluate

func (IssuedBy) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (IssuedBy) Name

func (IssuedBy) Name() string

type KeyUsageCA

type KeyUsageCA struct{}

func (KeyUsageCA) Evaluate

func (KeyUsageCA) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (KeyUsageCA) Name

func (KeyUsageCA) Name() string

type KeyUsageLeaf

type KeyUsageLeaf struct{}

func (KeyUsageLeaf) Evaluate

func (KeyUsageLeaf) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (KeyUsageLeaf) Name

func (KeyUsageLeaf) Name() string

type Lt

type Lt struct{}

func (Lt) Evaluate

func (Lt) Evaluate(n *node.Node, ctx *EvaluationContext, operands []any) (bool, error)

func (Lt) Name

func (Lt) Name() string

type Lte

type Lte struct{}

func (Lte) Evaluate

func (Lte) Evaluate(n *node.Node, ctx *EvaluationContext, operands []any) (bool, error)

func (Lte) Name

func (Lte) Name() string

type Matches

type Matches struct{}

func (Matches) Evaluate

func (Matches) Evaluate(n *node.Node, ctx *EvaluationContext, operands []any) (bool, error)

func (Matches) Name

func (Matches) Name() string

type MaxLength

type MaxLength struct{}

func (MaxLength) Evaluate

func (MaxLength) Evaluate(n *node.Node, _ *EvaluationContext, operands []any) (bool, error)

func (MaxLength) Name

func (MaxLength) Name() string

type MinLength

type MinLength struct{}

func (MinLength) Evaluate

func (MinLength) Evaluate(n *node.Node, _ *EvaluationContext, operands []any) (bool, error)

func (MinLength) Name

func (MinLength) Name() string

type NameConstraintsValid

type NameConstraintsValid struct{}

func (NameConstraintsValid) Evaluate

func (NameConstraintsValid) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (NameConstraintsValid) Name

type Neq

type Neq struct{}

func (Neq) Evaluate

func (Neq) Evaluate(n *node.Node, _ *EvaluationContext, operands []any) (bool, error)

func (Neq) Name

func (Neq) Name() string

type NoUniqueIdentifiers

type NoUniqueIdentifiers struct{}

func (NoUniqueIdentifiers) Evaluate

func (NoUniqueIdentifiers) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (NoUniqueIdentifiers) Name

func (NoUniqueIdentifiers) Name() string

type NoUnknownCriticalExtensions

type NoUnknownCriticalExtensions struct{}

func (NoUnknownCriticalExtensions) Evaluate

func (NoUnknownCriticalExtensions) Name

type NotCritical

type NotCritical struct{}

func (NotCritical) Evaluate

func (NotCritical) Evaluate(n *node.Node, _ *EvaluationContext, _ []any) (bool, error)

func (NotCritical) Name

func (NotCritical) Name() string

type NotEmpty

type NotEmpty struct{}

func (NotEmpty) Evaluate

func (NotEmpty) Evaluate(n *node.Node, _ *EvaluationContext, _ []any) (bool, error)

func (NotEmpty) Name

func (NotEmpty) Name() string

type NotIn

type NotIn struct{}

func (NotIn) Evaluate

func (NotIn) Evaluate(n *node.Node, _ *EvaluationContext, operands []any) (bool, error)

func (NotIn) Name

func (NotIn) Name() string

type NotRegex

type NotRegex struct{}

func (NotRegex) Evaluate

func (NotRegex) Evaluate(n *node.Node, _ *EvaluationContext, operands []any) (bool, error)

func (NotRegex) Name

func (NotRegex) Name() string

type NotRevoked

type NotRevoked struct{}

func (NotRevoked) Evaluate

func (NotRevoked) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (NotRevoked) Name

func (NotRevoked) Name() string

type NotRevokedOCSP

type NotRevokedOCSP struct{}

func (NotRevokedOCSP) Evaluate

func (NotRevokedOCSP) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (NotRevokedOCSP) Name

func (NotRevokedOCSP) Name() string

type OCSPGood

type OCSPGood struct{}

func (OCSPGood) Evaluate

func (OCSPGood) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (OCSPGood) Name

func (OCSPGood) Name() string

type OCSPValid

type OCSPValid struct{}

func (OCSPValid) Evaluate

func (OCSPValid) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (OCSPValid) Name

func (OCSPValid) Name() string

type Odd

type Odd struct{}

func (Odd) Evaluate

func (Odd) Evaluate(n *node.Node, _ *EvaluationContext, _ []any) (bool, error)

func (Odd) Name

func (Odd) Name() string

type Operator

type Operator interface {
	Name() string
	Evaluate(n *node.Node, ctx *EvaluationContext, operands []any) (bool, error)
}

type PathLenValid

type PathLenValid struct{}

func (PathLenValid) Evaluate

func (PathLenValid) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (PathLenValid) Name

func (PathLenValid) Name() string

type Positive

type Positive struct{}

func (Positive) Evaluate

func (Positive) Evaluate(n *node.Node, _ *EvaluationContext, _ []any) (bool, error)

func (Positive) Name

func (Positive) Name() string

type Present

type Present struct{}

func (Present) Evaluate

func (Present) Evaluate(n *node.Node, _ *EvaluationContext, _ []any) (bool, error)

func (Present) Name

func (Present) Name() string

type Regex

type Regex struct{}

func (Regex) Evaluate

func (Regex) Evaluate(n *node.Node, _ *EvaluationContext, operands []any) (bool, error)

func (Regex) Name

func (Regex) Name() string

type Registry

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

func DefaultRegistry

func DefaultRegistry() *Registry

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Get

func (r *Registry) Get(name string) (Operator, error)

func (*Registry) Register

func (r *Registry) Register(op Operator)

func (*Registry) RegisterAll

func (r *Registry) RegisterAll(ops []Operator)

type SANRequiredIfEmptySubject

type SANRequiredIfEmptySubject struct{}

func (SANRequiredIfEmptySubject) Evaluate

func (SANRequiredIfEmptySubject) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (SANRequiredIfEmptySubject) Name

type SerialNumberUnique

type SerialNumberUnique struct{}

func (SerialNumberUnique) Evaluate

func (SerialNumberUnique) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (SerialNumberUnique) Name

func (SerialNumberUnique) Name() string

type SignatureAlgorithmMatchesTBS

type SignatureAlgorithmMatchesTBS struct{}

func (SignatureAlgorithmMatchesTBS) Evaluate

func (SignatureAlgorithmMatchesTBS) Name

type SignatureValid

type SignatureValid struct{}

func (SignatureValid) Evaluate

func (SignatureValid) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (SignatureValid) Name

func (SignatureValid) Name() string

type ValidityOrderCorrect

type ValidityOrderCorrect struct{}

func (ValidityOrderCorrect) Evaluate

func (ValidityOrderCorrect) Evaluate(_ *node.Node, ctx *EvaluationContext, _ []any) (bool, error)

func (ValidityOrderCorrect) Name

type ValidityPeriodDays

type ValidityPeriodDays struct{}

func (ValidityPeriodDays) Evaluate

func (ValidityPeriodDays) Evaluate(n *node.Node, ctx *EvaluationContext, operands []any) (bool, error)

func (ValidityPeriodDays) Name

func (ValidityPeriodDays) Name() string

Jump to

Keyboard shortcuts

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