filesystem

package
v0.0.0-...-d1cd67c Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2018 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	RootPath string
	// contains filtered or unexported fields
}

Directory layout:

RootPath (passed in `New`)

-> store.crt  (x509 Certificate)
-> store.key  (RSA private key)

func New

func New(path string) (*Store, error)

Create a new Filesystem Store. This is basically just a directory full of Certificates dumped there. Pretty boring, and a bit, well, insecure, but this is an example (and simple!) Store that will work for small and well controled deployments.

func (Store) Certificate

func (s Store) Certificate() (*x509.Certificate, error)

Read the Certificate off disk.

func (Store) Decrypt

func (s Store) Decrypt(rand io.Reader, msg []byte, opts crypto.DecrypterOpts) ([]byte, error)

We pull the PublicKey off disk during init, and we keep it in memory. Proxy the Decrypt method of the RSA PrivateKey.

func (Store) Public

func (s Store) Public() crypto.PublicKey

We pull the PrivateKey off disk during init, and we keep it in memory, since the interface has no error param passed out with it, so let's ensure we don't error out.

func (Store) Sign

func (s Store) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)

We pull the PublicKey off disk during init, and we keep it in memory. Proxy the Sign method of the RSA PrivateKey.

func (Store) Update

func (s Store) Update(certificate x509.Certificate) error

Write the Certificate to the disk.

Jump to

Keyboard shortcuts

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