Aker.SigningKey (Aker v0.1.0)

Copy Markdown View Source

A private Ed25519 key: a licence issuer's root key, or a working key the root key certifies. Only a signing task reads one, from a file kept off the repository and off every server. inspect/1 shows no key bytes, so a crash or a log line that holds the key prints none.

from_pem/1 takes what openssl genpkey -algorithm ed25519 writes: one unencrypted PKCS #8 block. It matches the block's fixed bytes instead of calling a decoder, so a file that is not such a key gets one fixed error and no exception that could print the file.

Summary

Functions

The key in a PEM file's text, or :error when the text is not one.

The key in the file at path, refused when the file sits inside repo, the checkout a signing task runs in, so a key cannot be committed by accident. Each failure is one fixed message that prints nothing of the file.

The raw 32-byte public key, base64, as a host's root key list holds it.

path absolute, with every symlink along it followed, as far as the links resolve. A part that does not exist is kept as written. Each .. applies after the link before it is followed, as the system applies it. More than 40 links answers {:error, :too_many_links}.

The 64-byte Ed25519 signature of message.

Types

t()

@opaque t()

Functions

from_pem(text)

@spec from_pem(binary()) :: {:ok, t()} | :error

The key in a PEM file's text, or :error when the text is not one.

load(path, repo)

@spec load(Path.t(), Path.t()) :: {:ok, t()} | {:error, String.t()}

The key in the file at path, refused when the file sits inside repo, the checkout a signing task runs in, so a key cannot be committed by accident. Each failure is one fixed message that prints nothing of the file.

public_key(signing_key)

@spec public_key(t()) :: String.t()

The raw 32-byte public key, base64, as a host's root key list holds it.

real_path(path)

@spec real_path(Path.t()) :: {:ok, Path.t()} | {:error, :too_many_links}

path absolute, with every symlink along it followed, as far as the links resolve. A part that does not exist is kept as written. Each .. applies after the link before it is followed, as the system applies it. More than 40 links answers {:error, :too_many_links}.

sign(signing_key, message)

@spec sign(t(), binary()) :: binary()

The 64-byte Ed25519 signature of message.