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§
- ParseRelay Version Error 
- 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.
- Signature
- A wrapper around a String that represents a signature.
- SignatureHeader 
- A wrapper around packed data that adds a timestamp.
- SignatureRef 
- A borrowed reference to a signature string used for validation.
- SignedRegister State 
- An encoded and signed RegisterState.
Enums§
- KeyParseError 
- Raised if a key could not be parsed.
- SignatureAlgorithm 
- Used to tell which algorithm was used for signature creation.
- UnpackError 
- 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).