Documentation ¶
Overview ¶
Package keys implements tools to manage HTTPS certificates and session keys for Mr. Plotter. The certificates are stored in etcd, so a Version 3 etcd client is needed for most of the API functions.
Index ¶
- func DeleteAutocertCache(ctx context.Context, etcdClient *etcd.Client, key string) error
- func DropAutocertCache(ctx context.Context, etcdClient *etcd.Client) error
- func GetAutocertCache(ctx context.Context, etcdClient *etcd.Client, key string) (string, error)
- func GetAutocertEmail(ctx context.Context, etcdClient *etcd.Client) (string, error)
- func GetAutocertHostname(ctx context.Context, etcdClient *etcd.Client) (string, error)
- func GetCertificateSource(ctx context.Context, etcdClient *etcd.Client) (string, error)
- func GetHttpsCertEtcdPath() string
- func PutAutocertCache(ctx context.Context, etcdClient *etcd.Client, key string, val string) error
- func SelfSignedCertificate(dnsNames []string) (*pem.Block, *pem.Block, error)
- func SerializeCertificate(certificate *tls.Certificate) (*pem.Block, *pem.Block, error)
- func SetAutocertEmail(ctx context.Context, etcdClient *etcd.Client, email string) error
- func SetAutocertHostname(ctx context.Context, etcdClient *etcd.Client, hostname string) error
- func SetCertificateSource(ctx context.Context, etcdClient *etcd.Client, source string) error
- func SetEtcdKeyPrefix(prefix string)
- func UpsertHardcodedTLSCertificate(ctx context.Context, etcdClient *etcd.Client, ...) error
- func UpsertHardcodedTLSCertificateAtomically(ctx context.Context, etcdClient *etcd.Client, ...) (bool, error)
- func UpsertSessionKeys(ctx context.Context, etcdClient *etcd.Client, sk *SessionKeys) error
- func UpsertSessionKeysAtomically(ctx context.Context, etcdClient *etcd.Client, sk *SessionKeys) (bool, error)
- type EtcdCache
- type HardcodedTLSCertificate
- type SessionKeys
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAutocertCache ¶
func GetAutocertCache ¶
func GetAutocertEmail ¶
func GetAutocertHostname ¶
func GetCertificateSource ¶
func GetHttpsCertEtcdPath ¶
func GetHttpsCertEtcdPath() string
Gets the base path for https certificates in etcd.
func PutAutocertCache ¶
func SelfSignedCertificate ¶
SelfSignedCertificate generates a self-signed certificate. Much of this is from https://golang.org/src/crypto/tls/generate_cert.go. All credit to the Go Authors.
func SerializeCertificate ¶
SerializeCertificate serializes a TLS certificate into the cert and key PEM files.
func SetAutocertEmail ¶
func SetAutocertHostname ¶
func SetCertificateSource ¶
func SetEtcdKeyPrefix ¶
func SetEtcdKeyPrefix(prefix string)
func UpsertSessionKeys ¶
Types ¶
type EtcdCache ¶
type EtcdCache struct {
// contains filtered or unexported fields
}
func NewEtcdCache ¶
type HardcodedTLSCertificate ¶
type HardcodedTLSCertificate struct { Cert []byte Key []byte // contains filtered or unexported fields }
func (*HardcodedTLSCertificate) GetRetrievedRevision ¶
func (h *HardcodedTLSCertificate) GetRetrievedRevision() int64
func (*HardcodedTLSCertificate) SetRetrievedRevision ¶
func (h *HardcodedTLSCertificate) SetRetrievedRevision(rev int64)
type SessionKeys ¶
type SessionKeys struct { EncryptKey []byte MACKey []byte // contains filtered or unexported fields }
func RetrieveSessionKeys ¶
func (*SessionKeys) GetRetrievedRevision ¶
func (sk *SessionKeys) GetRetrievedRevision() int64
func (*SessionKeys) SetRetrievedRevision ¶
func (sk *SessionKeys) SetRetrievedRevision(rev int64)
Click to show internal directories.
Click to hide internal directories.