Crate relay_auth

Source
Expand description

Authentication and crypto for Relay.

This library contains the PublicKey and SecretKey types, which can be used to validate and sign traffic between Relays in authenticated endpoints. Additionally, Relays identify via a RelayId, which is included in the request signature and headers.

Relay uses Ed25519 at the moment. This is considered an implementation detail and is subject to change at any time. Do not rely on a specific signing mechanism.

§Generating Credentials

Use the generate_relay_id and generate_key_pair function to generate credentials:

let relay_id = relay_auth::generate_relay_id();
let (private_key, public_key) = relay_auth::generate_key_pair();

Structs§

ParseRelayVersionError
Raised if Relay cannot parse the provided version.
PublicKey
Represents the public key of a Relay.
RegisterChallenge
Represents the response the server is supposed to send to a register request.
RegisterRequest
Represents a request for registration with the upstream.
RegisterResponse
Represents a response to a register challenge.
RegisterState
A state structure containing relevant information from RegisterRequest.
Registration
Represents the final registration.
RelayVersion
The version of a Relay.
SecretKey
Represents the secret key of an Relay.
SignatureHeader
A wrapper around packed data that adds a timestamp.
SignedRegisterState
An encoded and signed RegisterState.

Enums§

KeyParseError
Raised if a key could not be parsed.
UnpackError
Raised to indicate failure on unpacking.

Constants§

VERSION_MAJOR
VERSION_MINOR
VERSION_PATCH

Functions§

generate_key_pair
Generates a secret + public key pair.
generate_relay_id
Generates an Relay ID.

Type Aliases§

RelayId
Alias for Relay IDs (UUIDs).