revocation

package
v0.20250922.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: MPL-2.0 Imports: 1 Imported by: 160

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminAllowedReason added in v0.20250922.0

func AdminAllowedReason(r Reason) bool

AdminAllowedReason returns true if the given Reason is in the subset of Reasons which admins (i.e. people acting in CA Trusted Roles) are allowed to request. Reasons which do *not* appear here are those which are defined by RFC 5280 but are disallowed by the Baseline Requirements.

func UserAllowedReason added in v0.20250922.0

func UserAllowedReason(r Reason) bool

UserAllowedReason returns true if the given Reason is in the subset of Reasons which users are allowed to request.

Types

type Reason

type Reason int64

Reason is used to specify a certificate revocation reason

const (
	Unspecified          Reason = 0
	KeyCompromise        Reason = 1
	CACompromise         Reason = 2
	AffiliationChanged   Reason = 3
	Superseded           Reason = 4
	CessationOfOperation Reason = 5
	CertificateHold      Reason = 6
	// 7 is unused
	RemoveFromCRL      Reason = 8
	PrivilegeWithdrawn Reason = 9
	AACompromise       Reason = 10
)

The enumerated reasons for revoking a certificate. See RFC 5280: https://datatracker.ietf.org/doc/html/rfc5280#section-5.3.1.

func StringToReason added in v0.20250922.0

func StringToReason(s string) (Reason, error)

StringToReason converts a revocation reason string (such as "keyCompromise") into the corresponding integer reason code (e.g. 1).

func (Reason) String added in v0.20250922.0

func (r Reason) String() string

String converts a revocation reason code (such as 0) into its corresponding reason string (e.g. "unspecified").

The receiver *must* be one of the valid reason code constants defined in this package: this method will panic if called on an invalid Reason. It is expected that this method is only called on const Reasons, or after a call to UserAllowedReason or AdminAllowedReason.

Jump to

Keyboard shortcuts

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