...

Package helper

import "github.com/letsencrypt/boulder/test/ocsp/helper"
Overview
Index

Overview ▾

Variables

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

func GetIssuer(cert *x509.Certificate) (*x509.Certificate, error)

func GetIssuerFile

func GetIssuerFile(f string) (*x509.Certificate, error)

func PrettyResponse

func PrettyResponse(resp *ocsp.Response) string

func RegisterFlags

func RegisterFlags()

RegisterFlags registers command-line flags that affect OCSP checking.

func Req

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

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

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

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.

type Config

Config contains fields which control various behaviors of the checker's behavior.

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

func ConfigFromFlags

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 (Config) WithExpectReason

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 (Config) WithExpectStatus

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 (Config) WithOutput

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

type StatusCodeError struct {
    Code int
    Body []byte
}

func (StatusCodeError) Error

func (e StatusCodeError) Error() string