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§
Source§impl OuterLayer
impl OuterLayer
Sourcepub fn parse(content: &str) -> Result<Self, Error>
pub fn parse(content: &str) -> Result<Self, Error>
Parses the outer layer from decrypted content.
§Arguments
content- Decrypted outer layer content
§Returns
A parsed OuterLayer on success.
§Errors
Returns Error::Parse if the content is malformed.
§Example
// After decrypting the superencrypted blob
let outer = OuterLayer::parse(&decrypted_content)?;Trait Implementations§
Source§impl Clone for OuterLayer
impl Clone for OuterLayer
Source§fn clone(&self) -> OuterLayer
fn clone(&self) -> OuterLayer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more