pub struct PairingResponse {
pub short_code: String,
pub device_ephemeral_pubkey: String,
pub device_signing_pubkey: String,
pub curve: CurveTag,
pub device_did: String,
pub signature: String,
pub device_name: Option<String>,
}Expand description
A response to a pairing request from the responding device.
The curve field carries the device’s signing curve in-band, so verifiers
never infer curve from pubkey byte length (a silent-correctness hazard —
see docs/architecture/cryptography.md → Wire-format Curve Tagging). The
serialized value is "ed25519" or "p256".
Fields§
§short_code: String§device_ephemeral_pubkey: String§device_signing_pubkey: String§curve: CurveTagCurve tag for device_signing_pubkey / signature. Absent → defaults to P256
per the approved Wire-format Curve Tagging rule.
device_did: String§signature: String§device_name: Option<String>Implementations§
Source§impl PairingResponse
impl PairingResponse
Sourcepub fn create(
now: DateTime<Utc>,
token: &PairingToken,
device_seed: &TypedSeed,
device_pubkey: &[u8],
device_did: String,
device_name: Option<String>,
) -> Result<(Self, Zeroizing<[u8; 32]>), ProtocolError>
pub fn create( now: DateTime<Utc>, token: &PairingToken, device_seed: &TypedSeed, device_pubkey: &[u8], device_did: String, device_name: Option<String>, ) -> Result<(Self, Zeroizing<[u8; 32]>), ProtocolError>
Create a new pairing response (responder side).
The device’s curve flows through the typed seed — no byte-length guessing.
The emitted curve field records the signer’s curve so verifiers read it
off the wire instead of inferring from pubkey length.
Args:
now- Current time for expiry checkingtoken- The pairing token from the initiating devicedevice_seed- Typed signing seed (curve carried in-band)device_pubkey- The responding device’s public key (length matches curve)device_did- The responding device’s DID stringdevice_name- Optional friendly name for the device
Sourcepub fn verify(
&self,
now: DateTime<Utc>,
token: &PairingToken,
) -> Result<(), ProtocolError>
pub fn verify( &self, now: DateTime<Utc>, token: &PairingToken, ) -> Result<(), ProtocolError>
Verify the response’s signature using the curve tag carried on the wire.
Curve dispatch reads self.curve directly — never inferred from pubkey
byte length. See docs/architecture/cryptography.md → Wire-format Curve
Tagging.
Sourcepub fn device_ephemeral_pubkey_bytes(&self) -> Result<Vec<u8>, ProtocolError>
pub fn device_ephemeral_pubkey_bytes(&self) -> Result<Vec<u8>, ProtocolError>
Decode the device’s ephemeral P-256 ECDH public key from base64url.
pub fn device_signing_pubkey_bytes(&self) -> Result<Vec<u8>, ProtocolError>
Trait Implementations§
Source§impl Clone for PairingResponse
impl Clone for PairingResponse
Source§fn clone(&self) -> PairingResponse
fn clone(&self) -> PairingResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more