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§
- Raised if Relay cannot parse the provided version.
- Represents the public key of a Relay.
- Represents the response the server is supposed to send to a register request.
- Represents a request for registration with the upstream.
- Represents a response to a register challenge.
- A state structure containing relevant information from
RegisterRequest
. - Represents the final registration.
- The version of a Relay.
- Represents the secret key of an Relay.
- A wrapper around packed data that adds a timestamp.
- An encoded and signed
RegisterState
.
Enums§
- Raised if a key could not be parsed.
- Raised to indicate failure on unpacking.
Constants§
Functions§
- Generates a secret + public key pair.
- Generates an Relay ID.
Type Aliases§
- Alias for Relay IDs (UUIDs).