SaltDns. Certificates. Store behaviour
(Salt v1.0.0)
Where the private keys and chains of certificate versions are kept: one
immutable object per version, certificates/<certificate id>/<serial>,
written once and never overwritten. Salt DNS encrypts every object itself
(SaltDns.Certificates.StoreCrypto) before it reaches the backend, so the
backend only ever holds ciphertext. Postgres holds the facts about a
version, never its private key.
Two backends implement this behaviour: SaltDns.Certificates.Store.S3 (any
S3-compatible service, Garage is the target) and
SaltDns.Certificates.Store.Local (a directory, for development and tests).
Choose with config :salt_dns, SaltDns.Certificates, store: :s3 | :local.
The only objects that are ever deleted are the short-lived ones holding the
key of an order that has not yielded a certificate yet (pending/...).
Summary
Callbacks
Writes the object only if it does not exist yet: {:error, :exists} otherwise.
Functions
The configured backend module.
Deletes an object (only for pending_key/2 objects).
The object key of the key of an order that has no certificate yet.
Reads and decrypts the object at key.
The id of the store key an existing object was encrypted with.
The object key of a version.
Encrypts plaintext and writes it at key. Returns the id of the store
key used. An existing object is an error ({:error, :exists}).
Types
@type key() :: String.t()
Callbacks
Writes the object only if it does not exist yet: {:error, :exists} otherwise.
Functions
@spec backend() :: module()
The configured backend module.
Deletes an object (only for pending_key/2 objects).
The object key of the key of an order that has no certificate yet.
Reads and decrypts the object at key.
The id of the store key an existing object was encrypted with.
The object key of a version.
Encrypts plaintext and writes it at key. Returns the id of the store
key used. An existing object is an error ({:error, :exists}).