pub struct SessionState {
pub self_actor: String,
pub peer_actor: String,
pub peer_actor_claim: Option<String>,
pub session_id: Vec<u8>,
pub generation: u32,
pub send_key: [u8; 32],
pub recv_key: [u8; 32],
pub send_seq: u64,
pub recv_seq: u64,
pub closed: bool,
/* private fields */
}Fields§
§self_actor: String§peer_actor: StringKey-derived canonical peer actor URI. Authoritative.
peer_actor_claim: Option<String>Self-claimed peer actor URI from peer_hint. Advisory only.
session_id: Vec<u8>§generation: u32§send_key: [u8; 32]§recv_key: [u8; 32]§send_seq: u64§recv_seq: u64§closed: boolImplementations§
Source§impl SessionState
impl SessionState
pub fn derive( role: Role, shared_secret: &[u8; 32], session_id: &[u8], transcript_hash: &[u8], self_actor: &str, peer_actor: &str, ) -> Self
pub fn derive_with_claim( role: Role, shared_secret: &[u8; 32], session_id: &[u8], transcript_hash: &[u8], self_actor: &str, peer_actor: &str, peer_actor_claim: Option<String>, ) -> Self
pub fn encrypt(&mut self, frame: &SessionFrame) -> Result<Vec<u8>, SessionError>
pub fn decrypt(&mut self, bytes: &[u8]) -> Result<SessionFrame, SessionError>
pub fn request_rekey( &mut self, seed: Option<[u8; 32]>, ) -> Result<Vec<u8>, SessionError>
pub fn process_rekey_req( &mut self, peer_eph_pub_b64: &str, seed: Option<[u8; 32]>, ) -> Result<Vec<u8>, SessionError>
pub fn process_rekey_ack( &mut self, peer_eph_pub_b64: &str, ) -> Result<(), SessionError>
Trait Implementations§
Source§impl Clone for SessionState
impl Clone for SessionState
Source§fn clone(&self) -> SessionState
fn clone(&self) -> SessionState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SessionState
impl RefUnwindSafe for SessionState
impl Send for SessionState
impl Sync for SessionState
impl Unpin for SessionState
impl UnsafeUnpin for SessionState
impl UnwindSafe for SessionState
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more