pub struct PairingSession {
pub token: PairingToken,
/* private fields */
}Expand description
Ephemeral keypair for a pairing session.
The X25519 secret is consumed once during ECDH key exchange.
EphemeralSecret is !Clone + !Serialize — sessions cannot be persisted.
Fields§
§token: PairingTokenImplementations§
Source§impl PairingSession
impl PairingSession
Sourcepub fn complete_exchange(
&mut self,
responder_x25519_pubkey: &[u8; 32],
) -> Result<Zeroizing<[u8; 32]>, ProtocolError>
pub fn complete_exchange( &mut self, responder_x25519_pubkey: &[u8; 32], ) -> Result<Zeroizing<[u8; 32]>, ProtocolError>
Complete the ECDH exchange with the responder’s X25519 public key.
Consumes the ephemeral secret (one-time use). Returns the 32-byte shared secret.
pub fn ephemeral_pubkey_bytes(&self) -> Result<[u8; 32], ProtocolError>
Sourcepub fn verify_response(
&self,
device_ed25519_pubkey: &[u8],
device_x25519_pubkey: &[u8; 32],
signature: &[u8],
) -> Result<(), ProtocolError>
pub fn verify_response( &self, device_ed25519_pubkey: &[u8], device_x25519_pubkey: &[u8; 32], signature: &[u8], ) -> Result<(), ProtocolError>
Verify a pairing response’s Ed25519 signature using ring directly.
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