Documentation ¶
Index ¶
- type Store
- func (s Store) Certificate() (*x509.Certificate, error)
- func (s Store) Decrypt(rand io.Reader, msg []byte, opts crypto.DecrypterOpts) ([]byte, error)
- func (s Store) Public() crypto.PublicKey
- func (s Store) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)
- func (s Store) Update(certificate x509.Certificate) error
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 ¶
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 ¶
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.