DefaultConfig is a Config populated with a set of curated default values intended for library test usage of this package.
var DefaultConfig = Config{ // contains filtered or unexported fields }
func GetIssuer(cert *x509.Certificate) (*x509.Certificate, error)
func GetIssuerFile(f string) (*x509.Certificate, error)
func PrettyResponse(resp *ocsp.Response) string
func RegisterFlags()
RegisterFlags registers command-line flags that affect OCSP checking.
func Req(cert *x509.Certificate, config Config) (*ocsp.Response, error)
Req makes an OCSP request using the given config for the given in-memory certificate, and returns the response.
func ReqDER(der []byte, config Config) (*ocsp.Response, error)
ReqDER makes an OCSP request using the given config for the given DER-encoded certificate, and returns the response.
func ReqFile(fileName string, config Config) (*ocsp.Response, error)
ReqFile makes an OCSP request using the given config for the PEM-encoded certificate in fileName, and returns the response.
func ReqSerial(serialNumber *big.Int, config Config) (*ocsp.Response, error)
ReqSerial makes an OCSP request using the given config for a certificate only identified by serial number. It requires that the Config have issuerFile set.
Config contains fields which control various behaviors of the checker's behavior.
type Config struct {
// contains filtered or unexported fields
}
func ConfigFromFlags() (Config, error)
ConfigFromFlags returns a Config whose values are populated from any command line flags passed by the user, or default values if not passed. However, it replaces io.Discard with os.Stdout so that CLI usages of this package will produce output on stdout by default.
func (template Config) WithExpectReason(reason int) Config
WithExpectReason returns a new Config with the given expectReason, and all other fields the same as the receiver.
func (template Config) WithExpectStatus(status int) Config
WithExpectStatus returns a new Config with the given expectStatus, and all other fields the same as the receiver.
func (template Config) WithOutput(w io.Writer) Config
WithOutput returns a new Config with the given output, and all other fields the same as the receiver.
type StatusCodeError struct { Code int Body []byte }
func (e StatusCodeError) Error() string