Struct ockam_identity::models::Credential
source · pub struct Credential {
pub data: Vec<u8>,
pub signature: CredentialSignature,
}
Expand description
Credential
Fields§
§data: Vec<u8>
CBOR serialized super::VersionedData
where VersionedData::data is CBOR serialized CredentialData
and VersionedData::data_type is CREDENTIAL_DATA_TYPE
signature: CredentialSignature
Signature over data field using corresponding Credentials super::PurposeKeyAttestation
Implementations§
source§impl Credential
impl Credential
sourcepub fn create_versioned_data(data: Vec<u8>) -> VersionedData
pub fn create_versioned_data(data: Vec<u8>) -> VersionedData
Create VersionedData
with corresponding version and data_type
sourcepub fn get_credential_data(&self) -> Result<CredentialData>
pub fn get_credential_data(&self) -> Result<CredentialData>
Extract CredentialData
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<'bytes, Ctx> Decode<'bytes, Ctx> for Credential
impl<'bytes, Ctx> Decode<'bytes, Ctx> for Credential
source§impl<Ctx> Encode<Ctx> for Credential
impl<Ctx> Encode<Ctx> for Credential
source§impl PartialEq for Credential
impl PartialEq 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 ==
.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<D> AsyncTryClone for D
impl<D> AsyncTryClone for D
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.