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§
- Parse
Relay Version Error - Raised if Relay cannot parse the provided version.
- Public
Key - Represents the public key of a Relay.
- Register
Challenge - Represents the response the server is supposed to send to a register request.
- Register
Request - Represents a request for registration with the upstream.
- Register
Response - Represents a response to a register challenge.
- Register
State - A state structure containing relevant information from
RegisterRequest
. - Registration
- Represents the final registration.
- Relay
Version - The version of a Relay.
- Secret
Key - Represents the secret key of an Relay.
- Signature
Header - A wrapper around packed data that adds a timestamp.
- Signed
Register State - An encoded and signed
RegisterState
.
Enums§
- KeyParse
Error - Raised if a key could not be parsed.
- Unpack
Error - Raised to indicate failure on unpacking.
Constants§
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).