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 task_context: Option<String>,
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
task_context: Option<String>Identifier (threadId) of the trust task exchange in which this credential was issued.
REQUIRED for DTGCredentialType::Witness credentials, OPTIONAL for all other DTG
credential types. A DTG credential without a taskContext MUST be interpretable
standing alone, independent of any exchange.
NOTE: A verifier MUST NOT interpret a taskContext-bearing credential as proof that
the associated trust task completed unless the matching trust task outcome evidence is
also present and verified.
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
Sourcepub fn task_context(&self) -> Option<&str>
pub fn task_context(&self) -> Option<&str>
The threadId of the trust task exchange this credential was issued in, if set