pub struct PreSharedKeyId { /* private fields */ }
Expand description
A PreSharedKeyID
is used to uniquely identify the PSKs that get injected
in the key schedule.
// draft-ietf-mls-protocol-19
struct {
PSKType psktype;
select (PreSharedKeyID.psktype) {
case external:
opaque psk_id<V>;
case resumption:
ResumptionPSKUsage usage;
opaque psk_group_id<V>;
uint64 psk_epoch;
};
opaque psk_nonce<V>;
} PreSharedKeyID;
Implementations§
Sourcepub fn new(
ciphersuite: Ciphersuite,
rand: &impl OpenMlsRand,
psk: Psk,
) -> Result<Self, CryptoError>
pub fn new( ciphersuite: Ciphersuite, rand: &impl OpenMlsRand, psk: Psk, ) -> Result<Self, CryptoError>
Construct a PreSharedKeyID
with a random nonce.
Sourcepub fn external(psk_id: Vec<u8>, psk_nonce: Vec<u8>) -> Self
pub fn external(psk_id: Vec<u8>, psk_nonce: Vec<u8>) -> Self
Construct an external PreSharedKeyID
.
Sourcepub fn resumption(
usage: ResumptionPskUsage,
psk_group_id: GroupId,
psk_epoch: GroupEpoch,
psk_nonce: Vec<u8>,
) -> Self
pub fn resumption( usage: ResumptionPskUsage, psk_group_id: GroupId, psk_epoch: GroupEpoch, psk_nonce: Vec<u8>, ) -> Self
Construct a resumption PreSharedKeyID
.
Trait Implementations§
Source§fn clone(&self) -> PreSharedKeyId
fn clone(&self) -> PreSharedKeyId
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
This function deserializes the
bytes
from the provided a std::io::Read
and returns the populated struct. Read moreSource§fn cmp(&self, other: &PreSharedKeyId) -> Ordering
fn cmp(&self, other: &PreSharedKeyId) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
fn tls_serialized_len(&self) -> usize
fn tls_serialized_len(&self) -> usize
Auto Trait Implementations§
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
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