Documentation ¶
Overview ¶
Package buffer provides helpers to decode PEM files, populate a tls.StoreWriter, and work with key and cert sets
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitCertSet ¶
func InitCertSet(out *CertSet, certs ...*tls.Certificate) error
InitCertSet initializes a preallocated CertSet.
func InitKeySet ¶
func InitKeySet(out *KeySet, keys ...x509utils.PrivateKey) error
InitKeySet initializes a preallocated KeySet.
func MustInitCertSet ¶
func MustInitCertSet(out *CertSet, certs ...*tls.Certificate)
MustInitCertSet is like InitCertSet but panics on errors.
func MustInitKeySet ¶
func MustInitKeySet(out *KeySet, keys ...x509utils.PrivateKey)
MustInitKeySet is like InitKeySet but panics on errors.
Types ¶
type CertSet ¶
type CertSet struct { set.Set[*x509.Certificate, certpool.Hash, *tls.Certificate] }
CertSet keeps a thread-safe set of unique [tls.Certificate]s.
func MustCertSet ¶
func MustCertSet(certs ...*tls.Certificate) *CertSet
MustCertSet is like NewCertSet but panics on errors.
func NewCertSet ¶
func NewCertSet(certs ...*tls.Certificate) (*CertSet, error)
NewCertSet creates a CertSet optionally taking its initial content as argument.
type KeySet ¶
KeySet keeps a thread-safe set of unique [x509utils.PrivateKey]s.
func MustKeySet ¶
func MustKeySet(keys ...x509utils.PrivateKey) *KeySet
MustKeySet is like NewKeySet but panics on errors.
func NewKeySet ¶
func NewKeySet(keys ...x509utils.PrivateKey) (*KeySet, error)
NewKeySet creates a KeySet optionally taking its initial content as argument.
func (*KeySet) Copy ¶
Copy copies all keys that satisfy the condition to the destination KeySet unless they are already there. If a destination isn't provided one will be created. If a condition function isn't provided, all keys not present in the destination will be added.
func (*KeySet) GetFromCertificate ¶
func (ks *KeySet) GetFromCertificate(cert *x509.Certificate) (x509utils.PrivateKey, error)
GetFromCertificate is like Get but uses the public key associated with the given certificate.