ocsp

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package ocsp provides methods for checking the OCSP revocation status of a certificate chain, as well as errors related to these checks

Package ocsp provides methods for checking the OCSP revocation status of a certificate chain, as well as errors related to these checks

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertCheckStatus

func CertCheckStatus(ctx context.Context, cert, issuer *x509.Certificate, opts CertCheckStatusOptions) *result.CertRevocationResult

CertCheckStatus checks the revocation status of a certificate using OCSP

func Supported

func Supported(cert *x509.Certificate) bool

Supported returns true if the certificate supports OCSP.

Types

type CertCheckStatusOptions

type CertCheckStatusOptions struct {
	// HTTPClient is the HTTP client used to perform the OCSP request
	HTTPClient *http.Client

	// SigningTime is used to compare with the invalidity date during revocation
	SigningTime time.Time
}

CertCheckStatusOptions specifies values that are needed to check OCSP revocation

type GenericError

type GenericError struct {
	Err error
}

GenericError is returned when there is an error during the OCSP revocation check, not necessarily a revocation

func (GenericError) Error

func (e GenericError) Error() string

type NoServerError

type NoServerError struct{}

NoServerError is returned when the OCSPServer is not specified.

func (NoServerError) Error

func (e NoServerError) Error() string

type RevokedError

type RevokedError struct{}

RevokedError is returned when the certificate's status for OCSP is ocsp.Revoked

func (RevokedError) Error

func (e RevokedError) Error() string

type TimeoutError

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

TimeoutError is returned when the connection attempt to an OCSP URL exceeds the specified threshold

func (TimeoutError) Error

func (e TimeoutError) Error() string

type UnknownStatusError

type UnknownStatusError struct{}

UnknownStatusError is returned when the certificate's status for OCSP is ocsp.Unknown

func (UnknownStatusError) Error

func (e UnknownStatusError) Error() string

Jump to

Keyboard shortcuts

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