Documentation
¶
Index ¶
- func NewRouter(config Config) *http.ServeMux
- func NewVaultSourceFromHandleConfig(handleConfig *VaultSourceHandleConfig) (*vault_ocsp.VaultSource, error)
- func ParseOpenSslIndex(data []byte) (map[string]*OpenSslIndexRecord, error)
- type CaSourceHandleConfig
- type CertStatus
- type Config
- type KeyHsmConfig
- type LivenessProbeHandleConfig
- type OcspSourceHandleConfig
- type OpenSslIndexRecord
- type OpenSslSource
- type OpenSslSourceHandleConfig
- type ReadinessProbeHandleConfig
- type VaultConfig
- type VaultSourceHandleConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewVaultSourceFromHandleConfig ¶
func NewVaultSourceFromHandleConfig(handleConfig *VaultSourceHandleConfig) (*vault_ocsp.VaultSource, error)
NewVaultSourceFromHandleConfig creates VaultSources and adds the handle for the Ocsp Responder
func ParseOpenSslIndex ¶
func ParseOpenSslIndex(data []byte) (map[string]*OpenSslIndexRecord, error)
ParseOpenSslIndex parses csv byte data from an openssl ca database flat file https://pki-tutorial.readthedocs.io/en/latest/cadb.html
Types ¶
type CaSourceHandleConfig ¶
type CaSourceHandleConfig struct { // CaCertPattern is pattern for the router handle CaCertPattern string `yaml:"certPattern"` // CaCertPath is a required Uri (file path or http url) CaCertPath string `yaml:"certPath"` // CaCrlPattern pattern for the router handle CaCrlPattern string `yaml:"crlPattern"` // CaCrlPath is a required Uri (file path or http url) CaCrlPath string `yaml:"crlPath"` // CaIncexPath is a required Uri (file path or http url) CaIndexPath string `yaml:"indexPath"` }
CaSourceHandleConfig are the OpenSSL CA certs, crls, and index
type CertStatus ¶
type CertStatus string
CertStatus are the possible values for Cert Status from the openssl ca database flat file
type Config ¶
type Config struct { // LogLevel LogLevel int `yaml:"logLevel"` Server struct { // Host is the local machine IP Address to bind the HTTP Server to Host string `yaml:"host"` // Port is the local machine TCP Port to bind the HTTP Server to Port string `yaml:"port"` // Time out Timeout struct { // Server is the general server timeout to use // for graceful shutdowns Server time.Duration `yaml:"server"` // Write is the amount of time to wait until an HTTP server // write opperation is cancelled Write time.Duration `yaml:"write"` // Read is the amount of time to wait until an HTTP server // read operation is cancelled Read time.Duration `yaml:"read"` // Idle is the amount of time to wait // until an IDLE HTTP session is closed Idle time.Duration `yaml:"idle"` } `yaml:"timeout"` // ReadinessProbeHandles configures the handle for readiness probe ReadinessProbeHandle ReadinessProbeHandleConfig `yaml:"readinessProbeHandle"` // LivenessProbeHandles configures the handle for liveness probe LivenessProbeHandle LivenessProbeHandleConfig `yaml:"livenessProbeHandle"` // OpenSslSourceHandles configures Source and Handles for ocsp responder OpenSslSourceHandles []OpenSslSourceHandleConfig `yaml:"opensslSourceHandles,flow"` // VaultSourceHandles configures Source and Handles for ocsp responder VaultSourceHandles []VaultSourceHandleConfig `yaml:"vaultSourceHandles,flow"` } `yaml:"server"` }
Config struct for hsm ocsp server
type KeyHsmConfig ¶
type KeyHsmConfig struct { // ModulePath is path to PKCS#11 library. ModulePath string `yaml:"modulePath"` // SlotNumber identifies a token to use by the slot containing it. // negative value defaults to Token label SlotNumber int `yaml:"slotNumber"` // TokenLabel, used to identify the Token, which is prefered over SlotID TokenLabel string `yaml:"tokenLabel"` // KeyLabel, used to identify the KeyPair, which is prefered over the KeyID KeyLabel string `yaml:"keyLabel"` // KeyID, hex id used to identify the KeyPair, though not required to find if label is provided // KeyPairs must have a NON-EMPTY CKA_ID to be found KeyID string `yaml:"keyID"` // HSM Pin Pin string `required:"true" envconfig:"HSM_PIN" yaml:"pin"` }
KeyHsmConfig is used to configure a PKCS11 cryptoSigner
type LivenessProbeHandleConfig ¶
type LivenessProbeHandleConfig struct {
Pattern string `yaml:"pattern"`
}
LivenessProbeHandleConfig configures the handle for the Liveness Probe
type OcspSourceHandleConfig ¶
type OcspSourceHandleConfig struct { // Pattern is the pattern for the router handle OcspPattern string `yaml:"pattern"` // OscpCertPath is a required Uri (file path or http url) OcspCertPath string `yaml:"certPath"` // OcspKeyPath is the optional Uri (file path) OcspKeyPath string `yaml:"keyPath"` // OcspKeyHsm is used to configure a PKCS11 cryptoSigner // If OcspKeyPath is set to ” OcspKeyHsm KeyHsmConfig `yaml:"keyHsm"` }
OcspSourceHandleConfig are the certs and keys required to sign OCSP responses
type OpenSslIndexRecord ¶
type OpenSslIndexRecord struct {
// contains filtered or unexported fields
}
OpenSslIndexRecord for records from the openssl ca database flat file
func ParseOpenSslIndexRecord ¶
func ParseOpenSslIndexRecord(record []string) (*OpenSslIndexRecord, error)
ParseOpenSslIndexRecord creates a new struct from csv record
type OpenSslSource ¶
type OpenSslSource struct {
// contains filtered or unexported fields
}
OpenSslSource Source struct for ocsp responder
func NewOpenSslSource ¶
func NewOpenSslSource(certIndex map[string]*OpenSslIndexRecord, caCrl *pkix.CertificateList, caCert *x509.Certificate, ocspCert *x509.Certificate, ocspSigner *crypto.Signer) (*OpenSslSource, error)
NewOpenSslSource creates a Source for OCSP server responder
func NewOpenSslSourceFromHandleConfig ¶
func NewOpenSslSourceFromHandleConfig(handleConfig OpenSslSourceHandleConfig) (*OpenSslSource, error)
NewOpenSslSourceFromHandleConfig creates OpenSslSources and adds the handle for the Ocsp Responder
func (OpenSslSource) Response ¶
Response required function for OCSP responder interface https://github.com/cloudflare/cfssl/blob/master/revoke/revoke.go
type OpenSslSourceHandleConfig ¶
type OpenSslSourceHandleConfig struct { OcspSourceHandle OcspSourceHandleConfig `yaml:"ocsp"` CaSourceHandleConfig `yaml:"ca"` }
OpenSslSourceHandleConfig configures the OCSP Sources for the ocsp responder
type ReadinessProbeHandleConfig ¶
type ReadinessProbeHandleConfig struct {
Pattern string `yaml:"pattern"`
}
ReadinessProbeHandleConfig configures the handle for the Readiness Probe
type VaultConfig ¶
type VaultConfig struct { // VaultMount is the pki mount for your ocsp (assumes ca, crl, and cert vault urls) PkiMount string `yaml:"pkiMount"` Client api.Config `yaml:"api"` }
VaultConfig configures the OCSP Sources for the ocsp responder
type VaultSourceHandleConfig ¶
type VaultSourceHandleConfig struct { OcspSourceHandle OcspSourceHandleConfig `yaml:"ocsp"` VaultConfig `yaml:"vault"` }
VaultSourceHandleConfig Source config for the ocsp responder http server(s)