driver

package
v0.0.0-...-465bddc Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package driver exposes interfaces and types certgraph drivers must implement

Index

Constants

This section is empty.

Variables

View Source
var Drivers []string

Drivers contains all the drivers that have been registered

Functions

func AddDriver

func AddDriver(name string)

AddDriver should be called in the init() function of every driver to register them here

func CertsToPEMFile

func CertsToPEMFile(certs []*x509.Certificate, file string) error

CertsToPEMFile saves certificates to local pem file

func Example

func Example(domain string, driver Driver) error

Example provides a simple entrypoint to test a driver on an individual domain

func RawCertToPEMFile

func RawCertToPEMFile(cert []byte, file string) error

RawCertToPEMFile saves raw certificate to local pem file

Types

type CertResult

type CertResult struct {
	Fingerprint fingerprint.Fingerprint
	Domains     []string
}

CertResult is an object to hold the fingerprint and Domains for a returned certificate

func NewCertResult

func NewCertResult(cert *x509.Certificate) *CertResult

NewCertResult creates a new CertResult struct from an x509 cert

type Driver

type Driver interface {
	// QueryDomain is the main entrypoint for Driver Searching
	// The domain provided will return a CertDriver instance which can be used to query the
	// certificates for the provided domain using the driver
	QueryDomain(domain string) (Result, error)

	// GetName returns the name of the driver
	GetName() string
}

Driver is a universal unifying interface to support CT, http and much more!

type FingerprintMap

type FingerprintMap map[string][]fingerprint.Fingerprint

FingerprintMap stores a mapping of domains to Fingerprints returned from the driver in the case where multiple domains where queries (redirects, related, etc..) the matching certificates will be in this map the fingerprints returned are guaranteed to be a complete result for the domain's certs, but related domains may or may not be complete

func (FingerprintMap) Add

func (f FingerprintMap) Add(domain string, fp fingerprint.Fingerprint)

Add adds a domain and fingerprint to the map

type Result

type Result interface {
	// GetStatus returns the status of the initial domain queried with the Driver.QueryDomain call
	GetStatus() status.Map

	// returns a list of additional related domains discovered while looking up the provided domain
	GetRelated() ([]string, error)

	// GetFingerprints returns an array of the certificate fingerprints associated with the Domain
	// pass return fingerprints to QueryCert to get certificate details
	GetFingerprints() (FingerprintMap, error)

	// QueryCert returns the details of the provided certificate or an error if not found
	QueryCert(fp fingerprint.Fingerprint) (*CertResult, error)
}

Result is a sub-driver that allows querying certificate details from a previously queried domain

Directories

Path Synopsis
Package censys file implements a client to search Censys's CT database Certificate Transparency search
Package censys file implements a client to search Censys's CT database Certificate Transparency search
Package crtsh implements an unofficial API client for Comodo's Certificate Transparency search https://crt.sh/
Package crtsh implements an unofficial API client for Comodo's Certificate Transparency search https://crt.sh/
Package http implements a certgraph driver for obtaining SSL certificates over https
Package http implements a certgraph driver for obtaining SSL certificates over https
Package multi exposes a generic driver interface allowing you to merge the results of multiple other drivers
Package multi exposes a generic driver interface allowing you to merge the results of multiple other drivers
Package smtp implements a certgraph driver for obtaining SSL certificates over smtp with STARTTLS
Package smtp implements a certgraph driver for obtaining SSL certificates over smtp with STARTTLS

Jump to

Keyboard shortcuts

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