api

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2023 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorInvalidDomain = fmt.Errorf("an invalid domain name was provided")
)

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	Type   string `json:"type"`
	SHA256 string `json:"sha256"`
	Data   string `json:"data"`
}

Certificate represents a certificate object for the certspotter API. This is now deprecated and Issuance.CertDER and Issuance.CertSHA256 should be used instead.

type CertspotterClient

type CertspotterClient struct {
	Endpoint string
	Token    string
	Client   HTTPClient
}

CertspotterClient is a client for interacting with the certspotter API.

func (*CertspotterClient) GetIssuances

func (c *CertspotterClient) GetIssuances(domain string, matchWildcards, includeSubdomains bool, position uint64) ([]Issuance, error)

GetIssuances queries the certspotter API for new issuances.

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is an interface implementing for the http.Client Do function.

type Issuance

type Issuance struct {
	ID               uint64      `json:"id,string"`
	TBSSHA256        string      `json:"tbs_sha256"`
	Domains          []string    `json:"dns_names"`
	PubKeySHA256     string      `json:"pubkey_sha256"`
	Issuer           Issuer      `json:"issuer"`
	NotBefore        string      `json:"not_before"`
	NotAfter         string      `json:"not_after"`
	Cert             Certificate `json:"cert"` // deprecated
	CertDER          string      `json:"cert_der"`
	CertSHA256       string      `json:"cert_sha256"`
	ProblemReporting string      `json:"problem_reporting"`
	Revoked          bool        `json:"revoked"`
	Revocation       Revocation  `json:"revocation"`
}

Issuance represents an issuance object for the certspotter API.

type Issuer

type Issuer struct {
	Name         string   `json:"name"`
	PubKeySHA256 string   `json:"pubkey_sha256"`
	FriendlyName string   `json:"friendly_name"`
	Website      string   `json:"website"`
	CAADomains   []string `json:"caa_domains"`
	Operator     Operator `json:"operator"`
}

Issuer represents an issuer object for the certspotter API.

type Operator added in v1.1.0

type Operator struct {
	Name    string `json:"name"`
	Website string `json:"website"`
}

Operator represents an operator object for the certspotter API.

type Revocation added in v1.1.0

type Revocation struct {
	Time      string `json:"time"`
	Reason    *int   `json:"reason"`
	CheckedAt string `json:"checked_at"`
}

Revocation represents a revocation object for the certspotter API.

Jump to

Keyboard shortcuts

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