Documentation ¶
Overview ¶
Package ocsp provides functionality for checking the Online Certificate Status Protocol (OCSP) status of a given certificate.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OCSPChecker ¶
type OCSPChecker struct { // Certificate is the certificate to be checked. Certificate *x509.Certificate // Issuer is the issuer of the certificate. Issuer *x509.Certificate }
OCSPChecker holds the details of the certificate and its issuer. It provides methods to retrieve and check the OCSP response for the certificate.
func (*OCSPChecker) CheckOCSPStatus ¶
func (o *OCSPChecker) CheckOCSPStatus() error
CheckOCSPStatus retrieves the OCSP response using GetOCSPResp and checks if the certificate status is good. Returns an error if the OCSP response indicates an invalid status or if fetching the OCSP response fails.
func (*OCSPChecker) GetOCSPResp ¶
func (o *OCSPChecker) GetOCSPResp() (*ocsp.Response, error)
GetOCSPResp queries the OCSP server specified in the certificate and retrieves the OCSP response. Returns an OCSP response or an error if the OCSP server is not specified, the request fails, or the response parsing fails.