Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCertificate ¶
GetCertificate fetches the first certificate from a certificate chain.
func GetCertificateChain ¶
GetCertificateChain fetches a certificate chain from a remote source. If cfg is non-nil and spec refers to a TLS server, the provided TLS configuration will be used to control verification behavior (e.g., InsecureSkipVerify, RootCAs).
Types ¶
type Fetcher ¶
type Fetcher interface {
// Get retrieves the leaf certificate from the source.
Get() (*x509.Certificate, error)
// GetChain retrieves the entire chain from the Fetcher.
GetChain() ([]*x509.Certificate, error)
// String returns a string representation of the Fetcher.
String() string
}
Fetcher is an interface for fetching certificates from a remote source. It currently supports fetching from a server or a file.
type FileFetcher ¶
type FileFetcher struct {
// contains filtered or unexported fields
}
FileFetcher retrieves certificates from files on disk.
func NewFileFetcher ¶
func NewFileFetcher(path string) *FileFetcher
func (*FileFetcher) Get ¶
func (ff *FileFetcher) Get() (*x509.Certificate, error)
func (*FileFetcher) GetChain ¶
func (ff *FileFetcher) GetChain() ([]*x509.Certificate, error)
func (*FileFetcher) String ¶
func (ff *FileFetcher) String() string
type ServerFetcher ¶
type ServerFetcher struct {
// contains filtered or unexported fields
}
ServerFetcher retrieves certificates from a TLS connection.
func ParseServer ¶
func ParseServer(host string, cfg *tls.Config) (*ServerFetcher, error)
ParseServer parses a server string into a ServerFetcher. It can be a URL or a a host:port pair.
func (*ServerFetcher) Get ¶
func (sf *ServerFetcher) Get() (*x509.Certificate, error)
func (*ServerFetcher) GetChain ¶
func (sf *ServerFetcher) GetChain() ([]*x509.Certificate, error)
func (*ServerFetcher) String ¶
func (sf *ServerFetcher) String() string
Click to show internal directories.
Click to hide internal directories.