pub struct PairingSession {
pub token: PairingToken,
/* private fields */
}Expand description
Ephemeral keypair for a pairing session.
The X25519 secret is used once during ECDH key exchange with the
responding device. After complete_exchange(), the secret is consumed.
Fields§
§token: PairingTokenThe pairing token to share with the responding device.
Implementations§
Source§impl PairingSession
impl PairingSession
Sourcepub fn complete_exchange(
&mut self,
responder_x25519_pubkey: &[u8; 32],
) -> Result<Zeroizing<[u8; 32]>, PairingError>
pub fn complete_exchange( &mut self, responder_x25519_pubkey: &[u8; 32], ) -> Result<Zeroizing<[u8; 32]>, PairingError>
Complete the ECDH exchange with the responder’s X25519 public key.
Consumes the ephemeral secret (one-time use). Returns the 32-byte shared secret.
Sourcepub fn ephemeral_pubkey_bytes(&self) -> Result<[u8; 32], PairingError>
pub fn ephemeral_pubkey_bytes(&self) -> Result<[u8; 32], PairingError>
Get the ephemeral public key bytes.
Sourcepub fn verify_response(
&self,
device_ed25519_pubkey: &[u8],
device_x25519_pubkey: &[u8; 32],
signature: &[u8],
) -> Result<(), PairingError>
pub fn verify_response( &self, device_ed25519_pubkey: &[u8], device_x25519_pubkey: &[u8; 32], signature: &[u8], ) -> Result<(), PairingError>
Verify a pairing response’s Ed25519 signature.
The signed message is: short_code || initiator_x25519_pubkey || device_x25519_pubkey
Auto Trait Implementations§
impl Freeze for PairingSession
impl RefUnwindSafe for PairingSession
impl Send for PairingSession
impl Sync for PairingSession
impl Unpin for PairingSession
impl UnsafeUnpin for PairingSession
impl UnwindSafe for PairingSession
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