Struct openmls::credentials::Credential
source · pub struct Credential { /* private fields */ }
Expand description
Credential.
This struct contains MLS credential data, where the data depends on the
type. The CredentialType
always matches the MlsCredentialType
.
struct {
CredentialType credential_type;
select (Credential.credential_type) {
case basic:
opaque identity<V>;
case x509:
Certificate chain<V>;
};
} Credential;
Implementations§
source§impl Credential
impl Credential
sourcepub fn credential_type(&self) -> CredentialType
pub fn credential_type(&self) -> CredentialType
Returns the credential type.
sourcepub fn new(
identity: Vec<u8>,
credential_type: CredentialType
) -> Result<Self, CredentialError>
pub fn new( identity: Vec<u8>, credential_type: CredentialType ) -> Result<Self, CredentialError>
Creates and returns a new Credential
of the given
CredentialType
for the given identity.
If the credential holds key material, this is generated and stored in
the key store.
Returns an error if the given CredentialType
is not supported.
Trait Implementations§
source§impl Clone for Credential
impl Clone for Credential
source§fn clone(&self) -> Credential
fn clone(&self) -> Credential
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§impl Debug for Credential
impl Debug for Credential
source§impl<'de> Deserialize<'de> for Credential
impl<'de> Deserialize<'de> for Credential
source§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§impl Deserialize for Credential
impl Deserialize for Credential
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§impl From<MlsCredentialType> for Credential
impl From<MlsCredentialType> for Credential
source§fn from(mls_credential_type: MlsCredentialType) -> Self
fn from(mls_credential_type: MlsCredentialType) -> Self
Converts to this type from the input type.
source§impl PartialEq<Credential> for Credential
impl PartialEq<Credential> for Credential
source§fn eq(&self, other: &Credential) -> bool
fn eq(&self, other: &Credential) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Credential
impl Serialize for Credential
source§impl Serialize for Credential
impl Serialize for Credential
source§impl Size for Credential
impl Size for Credential
fn tls_serialized_len(&self) -> usize
impl Eq for Credential
impl StructuralEq for Credential
impl StructuralPartialEq for Credential
Auto Trait Implementations§
impl RefUnwindSafe for Credential
impl Send for Credential
impl Sync for Credential
impl Unpin for Credential
impl UnwindSafe for Credential
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