View Source Age.X25519 (age v0.1.0)

Internal helper functions for the X25519 identity format.

Link to this section Summary

Functions

Decodes the private key from a Bech32 string of format AGE-SECRET-KEY-1...

Decodes the public key from a Bech32 string of format age1...

X25519(secret, base) to derive a public key from a private key.

Helper function to derive the wrap key for the file key.

Encodes the private key as a Bech32 string of format AGE-SECRET-KEY-1...

Encodes the public key as a Bech32 string of format age1...

Generates a new public/private keypair.

Generates the stanza for file encryption from the given recipient and file key.

Link to this section Types

@type private_key() :: binary()
@type public_key() :: binary()

Link to this section Functions

Link to this function

decode_private_key(priv)

View Source
@spec decode_private_key(binary()) :: private_key()

Decodes the private key from a Bech32 string of format AGE-SECRET-KEY-1...

@spec decode_public_key(binary()) :: public_key()

Decodes the public key from a Bech32 string of format age1...

Link to this function

derive_public_key(private_key)

View Source
@spec derive_public_key(private_key()) :: public_key()

X25519(secret, base) to derive a public key from a private key.

Link to this function

derive_wrap_key(shared_secret, ephemeral_share, recipient)

View Source
@spec derive_wrap_key(binary(), binary(), public_key()) :: binary()

Helper function to derive the wrap key for the file key.

Link to this function

encode_private_key(priv)

View Source
@spec encode_private_key(private_key()) :: binary()

Encodes the private key as a Bech32 string of format AGE-SECRET-KEY-1...

@spec encode_public_key(public_key()) :: binary()

Encodes the public key as a Bech32 string of format age1...

@spec generate_keypair() :: {public_key(), private_key()}

Generates a new public/private keypair.

Link to this function

stanza(recipient, file_key)

View Source
@spec stanza(public_key(), binary()) :: {binary(), binary()}

Generates the stanza for file encryption from the given recipient and file key.