SaltDns.Dnssec.Key (Salt v1.0.0)

A DNSSEC key of a signed zone as the leader's Knot has it, kept in Postgres so that the other node can import it when it takes over (SaltDns.Dnssec.KeyExport, SaltDns.Dnssec.KeyImport).

The private key (pem) is an SaltDns.Encrypted.Binary field in the vault context "dnssec_key": encrypted on the way to the database, decrypted on the way back, redacted from inspect/1. SaltDns.Encrypted.Registry finds it for vault key rotation by its type. timers holds every key timer as keymgr prints it (created, publish, ready, active, ..., 0 for unset), because a timer that is not given on import defaults to "now".

Summary

Functions

Builds a changeset from a keymgr -j list entry and the plain PEM.

The PEM (already decrypted by the field type), or :error when there is none.

The timer names a key import must be given, all of them.

Types

t()

@type t() :: %SaltDns.Dnssec.Key{
  __meta__: term(),
  algorithm: term(),
  id: term(),
  inserted_at: term(),
  key_id: term(),
  pem: term(),
  removed_at: term(),
  role: term(),
  tag: term(),
  timers: term(),
  updated_at: term(),
  zone_id: term()
}

Functions

changeset(key, zone_id, listed, pem)

@spec changeset(
  %SaltDns.Dnssec.Key{
    __meta__: term(),
    algorithm: term(),
    id: term(),
    inserted_at: term(),
    key_id: term(),
    pem: term(),
    removed_at: term(),
    role: term(),
    tag: term(),
    timers: term(),
    updated_at: term(),
    zone_id: term()
  },
  integer(),
  map(),
  String.t() | nil
) :: Ecto.Changeset.t()

Builds a changeset from a keymgr -j list entry and the plain PEM.

private_key(key)

@spec private_key(%SaltDns.Dnssec.Key{
  __meta__: term(),
  algorithm: term(),
  id: term(),
  inserted_at: term(),
  key_id: term(),
  pem: term(),
  removed_at: term(),
  role: term(),
  tag: term(),
  timers: term(),
  updated_at: term(),
  zone_id: term()
}) :: {:ok, binary()} | :error

The PEM (already decrypted by the field type), or :error when there is none.

timer_names()

@spec timer_names() :: [String.t()]

The timer names a key import must be given, all of them.