Documentation
¶
Overview ¶
Package crlutil provides functionality for parsing and validating CRLs.
Index ¶
Constants ¶
const ContentType = "application/pkix-crl"
The Content-Type of CRLs, per RFC 5280
Variables ¶
This section is empty.
Functions ¶
func CheckJSON ¶
func CheckJSON(ctx context.Context, config *DownloadConfig, ca *x509.Certificate, jsonBytes []byte) error
CheckJSON parses a "JSON Array of Partitioned CRLs" (in the format expected by the CCADB) and attempts to download and validate each one using DownloadCRL.
Types ¶
type DownloadConfig ¶
DownloadConfig specifies the configuration for downloading CRLs. The zero value provides sensible defaults.
type RevocationList ¶
type RevocationList struct {
PublishedAt time.Time
Certificates []RevokedCertificate
NumBytes int
}
RevocationList represents a parsed Certificate Revocation List.
func DownloadCRL ¶
func DownloadCRL(ctx context.Context, config *DownloadConfig, ca *x509.Certificate, url string) (*RevocationList, error)
DownloadCRL downloads a CRL from the specified URL and parses and validates it with [ParseCRL].
func ParseRevocationList ¶
func ParseRevocationList(der []byte, ca *x509.Certificate, uri string) (*RevocationList, error)
ParseRevocationList parses a DER-encoded CRL and validates it. If ca is not nil, verifies the CRL signature and issuer match the CA certificate. If uri is not empty and the CRL contains an Issuing Distribution Point extension, verifies the URI is listed in the extension. Returns an error if the fails validation.
Source Files
¶
- download.go
- json.go
- parse.go