crlutil

package
v0.28.2 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: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintCRL

func PrintCRL(crl *CRL)

Types

type CRL

type CRL struct {
	Version             *big.Int             `json:"version"`
	SignatureAlgorithm  SignatureAlgorithm   `json:"signature_algorithm"`
	Issuer              DistinguishedName    `json:"issuer"`
	ThisUpdate          time.Time            `json:"this_update"`
	NextUpdate          time.Time            `json:"next_update"`
	RevokedCertificates []RevokedCertificate `json:"revoked_certificates"`
	Extensions          []Extension          `json:"extensions,omitempty"`
	Signature           *Signature           `json:"signature"`
	AuthorityKeyID      []byte
	Raw                 []byte
}

CRL is the JSON representation of a certificate revocation list.

func ParseCRL

func ParseCRL(b []byte) (*CRL, error)

func (*CRL) Verify

func (c *CRL) Verify(ca *x509.Certificate) bool

func (*CRL) VerifySignature

func (c *CRL) VerifySignature(ca *x509.Certificate) bool

type DistinguishedName

type DistinguishedName struct {
	Country            []string                 `json:"country,omitempty"`
	Organization       []string                 `json:"organization,omitempty"`
	OrganizationalUnit []string                 `json:"organizational_unit,omitempty"`
	Locality           []string                 `json:"locality,omitempty"`
	Province           []string                 `json:"province,omitempty"`
	StreetAddress      []string                 `json:"street_address,omitempty"`
	PostalCode         []string                 `json:"postal_code,omitempty"`
	SerialNumber       string                   `json:"serial_number,omitempty"`
	CommonName         string                   `json:"common_name,omitempty"`
	ExtraNames         map[string][]interface{} `json:"extra_names,omitempty"`
	// contains filtered or unexported fields
}

DistinguishedName is the JSON representation of the CRL issuer.

func (DistinguishedName) String

func (d DistinguishedName) String() string

String returns the one line representation of the distinguished name.

type Extension

type Extension struct {
	Name    string   `json:"-"`
	Details []string `json:"-"`
	// contains filtered or unexported fields
}

func (*Extension) AddDetail added in v0.27.4

func (e *Extension) AddDetail(detail string)

func (*Extension) AddDetailf

func (e *Extension) AddDetailf(format string, args ...any)

func (*Extension) MarshalJSON

func (e *Extension) MarshalJSON() ([]byte, error)

type RevokedCertificate

type RevokedCertificate struct {
	SerialNumber      string      `json:"serial_number"`
	RevocationTime    time.Time   `json:"revocation_time"`
	Extensions        []Extension `json:"extensions,omitempty"`
	SerialNumberBytes []byte      `json:"-"`
}

RevokedCertificate is the JSON representation of a certificate in a CRL.

type Signature

type Signature struct {
	SignatureAlgorithm SignatureAlgorithm `json:"signature_algorithm"`
	Value              []byte             `json:"value"`
	Valid              bool               `json:"valid"`
	Reason             string             `json:"reason,omitempty"`
}

Signature is the JSON representation of a CRL signature.

type SignatureAlgorithm

type SignatureAlgorithm struct {
	Name string `json:"name"`
	OID  string `json:"oid"`
	// contains filtered or unexported fields
}

func (SignatureAlgorithm) String

func (s SignatureAlgorithm) String() string

Jump to

Keyboard shortcuts

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