Documentation ¶
Overview ¶
Package secrets provides a utility to read pre-created or dynamically create keys and certificates for Things. Only intended for examples and demos NOT production use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct { Path string // location of key store on disk InMemory bool // contains filtered or unexported fields }
Store for keys and certificates for Things
func (*Store) Certificates ¶
func (s *Store) Certificates(thingID string) ([]*x509.Certificate, error)
Certificates returns the certificates associated with the given Key ID. If the store does not contain a JWK for that Key ID, a key is created and written to the store. If the store does not contain one or more certificates for that Key ID, a certificate is created using the CA certificate held within the store. Dynamic certificates are created anew each time and are not stored.
func (*Store) SetCertificateAuthority ¶
func (s *Store) SetCertificateAuthority(jwk *jose.JSONWebKey)
SetCertificateAuthority sets the CA certificate used by the store to create dynamic certificates.