secrets

package
v0.0.0-...-407663e Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

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.

func (*Store) Signer

func (s *Store) Signer(kid string) (crypto.Signer, error)

Signer returns a signer 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.

Jump to

Keyboard shortcuts

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