certs

package
v0.0.0-...-10e2fbd Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchCertificates

func FetchCertificates(url string) ([]*x509.Certificate, error)

Fetch X.509 certificates via the given URL.

func ParseDN

func ParseDN(dn string) (*pkix.Name, error)

Parse a Distinguished Name (DN) string.

func ReadCertificates

func ReadCertificates(filename string) ([]*x509.Certificate, error)

Read X.509 certificates from the given file.

func ServerCertificates

func ServerCertificates(network string, addr string) ([]*x509.Certificate, error)

Get the X.509 certificates used for encrypting the connection to the given server.

The server protocol must be TLS based (e.g. https, ldaps). The certificates are retrieved during the TLS handshake.

Types

type CertificateFactory

type CertificateFactory interface {
	Name() string
	New() (crypto.PrivateKey, *x509.Certificate, error)
}

type CertificateRequestFactory

type CertificateRequestFactory interface {
	Name() string
	New() (crypto.PrivateKey, *x509.CertificateRequest, error)
}

type Store

type Store interface {
	Name() string
	Entries() StoreEntries
	Entry(name string) (StoreEntry, error)
}

type StoreEntries

type StoreEntries interface {
	Reset()
	Next() StoreEntry
}

type StoreEntry

type StoreEntry interface {
	Name() string
	Store() Store
	HasKey() bool
	Key() (crypto.PrivateKey, error)
	HasCertificate() bool
	Certificate() (*x509.Certificate, error)
	HasCertificateRequest() bool
	CertificateRequest() (*x509.CertificateRequest, error)
	HasRevocationList() bool
	RevocationList() (*x509.RevocationList, error)
	Attributes() (*StoreEntryAttributes, error)
}

type StoreEntryAttributes

type StoreEntryAttributes struct {
	Provider string `json:"provider"`
}

Directories

Path Synopsis
* Copyright (c) 2023 Holger de Carne and contributors, All Rights Reserved.
* Copyright (c) 2023 Holger de Carne and contributors, All Rights Reserved.

Jump to

Keyboard shortcuts

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