pub struct IntroductionPointV3 {
pub link_specifiers: Vec<LinkSpecifier>,
pub onion_key_raw: Option<String>,
pub auth_key_cert: Option<String>,
pub enc_key_raw: Option<String>,
pub enc_key_cert: Option<String>,
pub legacy_key_raw: Option<String>,
pub legacy_key_cert: Option<String>,
}Expand description
Introduction point for a version 3 hidden service.
V3 introduction points use modern cryptography (Ed25519/X25519) and support multiple ways to specify the relay’s location via link specifiers.
§Fields
link_specifiers: How to connect to this introduction pointonion_key_raw: Base64 ntor key for the introduction handshakeauth_key_cert: Ed25519 certificate cross-certifying the signing keyenc_key_raw: Base64 encryption key for introduction requestsenc_key_cert: Ed25519 certificate for the encryption keylegacy_key_raw: Optional RSA key for backward compatibilitylegacy_key_cert: Optional certificate for the legacy key
§Cryptographic Keys
Each introduction point has several keys:
- Onion Key: X25519 key for the ntor handshake with the intro point
- Auth Key: Ed25519 key that authenticates the introduction point
- Enc Key: X25519 key for encrypting the introduction request
- Legacy Key: Optional RSA key for older clients
§Example
let inner_layer = InnerLayer::parse(decrypted_content)?;
for intro_point in inner_layer.introduction_points {
for spec in &intro_point.link_specifiers {
match spec {
LinkSpecifier::IPv4 { address, port } => {
println!("Connect to {}:{}", address, port);
}
_ => {}
}
}
}Fields§
§link_specifiers: Vec<LinkSpecifier>Link specifiers describing how to connect to this introduction point.
onion_key_raw: Option<String>Base64-encoded X25519 public key for ntor handshake.
auth_key_cert: Option<String>Ed25519 certificate cross-certifying the signing key with the auth key.
enc_key_raw: Option<String>Base64-encoded X25519 public key for encrypting introduction requests.
enc_key_cert: Option<String>Ed25519 certificate cross-certifying the signing key by the encryption key.
legacy_key_raw: Option<String>Optional base64-encoded RSA public key for legacy clients.
legacy_key_cert: Option<String>Optional certificate for the legacy RSA key.
Implementations§
Source§impl IntroductionPointV3
impl IntroductionPointV3
Sourcepub fn encode(&self) -> String
pub fn encode(&self) -> String
Encodes this introduction point to its descriptor format.
Produces the text representation suitable for inclusion in a hidden service descriptor’s inner layer.
§Returns
A string containing the encoded introduction point.
§Example
use stem_rs::descriptor::hidden::{IntroductionPointV3, LinkSpecifier};
let intro = IntroductionPointV3 {
link_specifiers: vec![LinkSpecifier::IPv4 {
address: "1.2.3.4".to_string(),
port: 9001,
}],
onion_key_raw: Some("AAAA...".to_string()),
auth_key_cert: None,
enc_key_raw: Some("BBBB...".to_string()),
enc_key_cert: None,
legacy_key_raw: None,
legacy_key_cert: None,
};
let encoded = intro.encode();
assert!(encoded.contains("introduction-point"));Trait Implementations§
Source§impl Clone for IntroductionPointV3
impl Clone for IntroductionPointV3
Source§fn clone(&self) -> IntroductionPointV3
fn clone(&self) -> IntroductionPointV3
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more