pub struct UnsignedVerifiableCredential {
pub context: Vec<Url>,
pub id: Option<Url>,
pub credential_type: Vec<String>,
pub name: Option<LanguageValue>,
pub description: Option<LanguageValue>,
pub issuer: Issuer,
pub credential_subject: Value,
pub valid_from: Option<DateTime<Utc>>,
pub valid_until: Option<DateTime<Utc>>,
pub credential_status: Option<Status>,
pub credential_schema: Option<Vec<CredentialSchema>>,
}Expand description
A Verifiable Credential as defined by the W3C Verifiable Credentials Data Model v2.0 - https://www.w3.org/TR/vc-data-model-2.0 WITHOUT the proof
Fields§
§context: Vec<Url>§id: Option<Url>§credential_type: Vec<String>§name: Option<LanguageValue>§description: Option<LanguageValue>§issuer: Issuer§credential_subject: Value§valid_from: Option<DateTime<Utc>>§valid_until: Option<DateTime<Utc>>§credential_status: Option<Status>§credential_schema: Option<Vec<CredentialSchema>>Implementations§
Source§impl UnsignedVerifiableCredential
impl UnsignedVerifiableCredential
Sourcepub fn sign(
self,
private_key: impl AsRef<[u8]>,
) -> Result<VerifiableCredential, Box<dyn Error>>
pub fn sign( self, private_key: impl AsRef<[u8]>, ) -> Result<VerifiableCredential, Box<dyn Error>>
Sign the Verifiable Credential with a private key. Creates a proof with default values and a custom proofValue.
Sourcepub fn sign_with_schema_check(
self,
private_key: impl AsRef<[u8]>,
schema: &Value,
) -> Result<VerifiableCredential, Box<dyn Error>>
pub fn sign_with_schema_check( self, private_key: impl AsRef<[u8]>, schema: &Value, ) -> Result<VerifiableCredential, Box<dyn Error>>
Sign the Verifiable Credential with a private key. Creates a proof with default values and a custom proofValue. Also performs a JSON schema check on the credentialSubject.
Source§impl UnsignedVerifiableCredential
impl UnsignedVerifiableCredential
Sourcepub fn sign_with_schema_check_from_url(
self,
private_key: impl AsRef<[u8]>,
schema_url: &str,
) -> Result<VerifiableCredential, Box<dyn Error>>
pub fn sign_with_schema_check_from_url( self, private_key: impl AsRef<[u8]>, schema_url: &str, ) -> Result<VerifiableCredential, Box<dyn Error>>
Sign the Verifiable Credential with a private key. Creates a proof with default values and a custom proofValue. Also performs a JSON schema check on the credentialSubject. The schema is fetched from a URL.
Trait Implementations§
Source§impl Clone for UnsignedVerifiableCredential
impl Clone for UnsignedVerifiableCredential
Source§fn clone(&self) -> UnsignedVerifiableCredential
fn clone(&self) -> UnsignedVerifiableCredential
Returns a duplicate 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 UnsignedVerifiableCredential
impl Debug for UnsignedVerifiableCredential
Source§impl<'de> Deserialize<'de> for UnsignedVerifiableCredential
impl<'de> Deserialize<'de> for UnsignedVerifiableCredential
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 PartialEq for UnsignedVerifiableCredential
impl PartialEq for UnsignedVerifiableCredential
Source§fn eq(&self, other: &UnsignedVerifiableCredential) -> bool
fn eq(&self, other: &UnsignedVerifiableCredential) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for UnsignedVerifiableCredential
Auto Trait Implementations§
impl Freeze for UnsignedVerifiableCredential
impl RefUnwindSafe for UnsignedVerifiableCredential
impl Send for UnsignedVerifiableCredential
impl Sync for UnsignedVerifiableCredential
impl Unpin for UnsignedVerifiableCredential
impl UnwindSafe for UnsignedVerifiableCredential
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