pub struct OuterLayer {
pub auth_type: Option<String>,
pub ephemeral_key: Option<String>,
pub clients: HashMap<String, AuthorizedClient>,
pub encrypted: Option<String>,
}Expand description
Outer encryption layer of a v3 hidden service descriptor.
The outer layer is the first layer of encryption in a v3 descriptor. It contains client authorization data and the encrypted inner layer.
§Structure
auth_type: Type of client authorization (e.g., “x25519”)ephemeral_key: Ephemeral X25519 public key for decryptionclients: Map of client IDs to their authorization dataencrypted: The encrypted inner layer (MESSAGE block)
§Decryption
To decrypt the outer layer, you need:
- The blinded public key derived from the service’s identity key
- The subcredential derived from the identity key and time period
The decryption uses AES-256-CTR with keys derived via SHAKE-256.
§Client Authorization
If auth_type is set, only clients listed in clients can decrypt the inner layer. Each client’s cookie is encrypted with their public key.
§Example
ⓘ
let outer = OuterLayer::parse(decrypted_superencrypted)?;
if let Some(auth_type) = &outer.auth_type {
println!("Authorization required: {}", auth_type);
println!("Authorized clients: {}", outer.clients.len());
}Fields§
§auth_type: Option<String>Type of client authorization (e.g., “x25519”), or None if public.
ephemeral_key: Option<String>Ephemeral X25519 public key for descriptor encryption.
clients: HashMap<String, AuthorizedClient>Map of client IDs to their authorization credentials.
encrypted: Option<String>Encrypted inner layer content (MESSAGE block).
Implementations§
Trait Implementations§
Source§impl Clone for OuterLayer
impl Clone for OuterLayer
Source§fn clone(&self) -> OuterLayer
fn clone(&self) -> OuterLayer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OuterLayer
impl Debug for OuterLayer
Source§impl PartialEq for OuterLayer
impl PartialEq for OuterLayer
impl StructuralPartialEq for OuterLayer
Auto Trait Implementations§
impl Freeze for OuterLayer
impl RefUnwindSafe for OuterLayer
impl Send for OuterLayer
impl Sync for OuterLayer
impl Unpin for OuterLayer
impl UnwindSafe for OuterLayer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more