Struct openmls::schedule::psk::PreSharedKeyId
source · 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
source§fn eq(&self, other: &PreSharedKeyId) -> bool
fn eq(&self, other: &PreSharedKeyId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§fn partial_cmp(&self, other: &PreSharedKeyId) -> Option<Ordering>
fn partial_cmp(&self, other: &PreSharedKeyId) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read morefn 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> 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