pub struct DTGCommon {
pub context: Vec<String>,
pub type_: Vec<String>,
pub issuer: String,
pub valid_from: DateTime<Utc>,
pub valid_until: Option<DateTime<Utc>>,
pub credential_subject: CredentialSubject,
pub proof: Option<DataIntegrityProof>,
}Expand description
All DTG Credentials follow a common structure.
Fields§
§context: Vec<String>JSON-LD links to contexts Must contain at least: https://www.w3.org/ns/credentials/v2 https://firstperson.network/credentials/dtg/v1
type_: Vec<String>Credential type identifiers Must contain at least: DTGCredential VerifiableCredential
issuer: StringDID of the entity issuing this credential
valid_from: DateTime<Utc>ISO 8601 format of when this credentials become valid from
valid_until: Option<DateTime<Utc>>ISO 8601 format of when these credentials are valid to
credential_subject: CredentialSubjectThe assertion between the entities involved
proof: Option<DataIntegrityProof>Cryptographic proof of credential authenticity
Implementations§
Source§impl DTGCommon
impl DTGCommon
Sourcepub fn signed(&self) -> bool
pub fn signed(&self) -> bool
Has this credential been signed? Returns true if a proof exists NOTE: This does NOT validate the proof itself
Sourcepub fn valid_from(&self) -> DateTime<Utc>
pub fn valid_from(&self) -> DateTime<Utc>
The credential is valid from this timestamp
Sourcepub fn valid_until(&self) -> Option<DateTime<Utc>>
pub fn valid_until(&self) -> Option<DateTime<Utc>>
The credential is valid until this timestamp, if set
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DTGCommon
impl<'de> Deserialize<'de> for DTGCommon
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
Auto Trait Implementations§
impl Freeze for DTGCommon
impl RefUnwindSafe for DTGCommon
impl Send for DTGCommon
impl Sync for DTGCommon
impl Unpin for DTGCommon
impl UnsafeUnpin for DTGCommon
impl UnwindSafe for DTGCommon
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