pub struct PassportCredential {
pub context: Vec<String>,
pub credential_type: Vec<String>,
pub id: String,
pub issuer: String,
pub valid_from: DateTime<Utc>,
pub credential_subject: PassportCredentialSubject,
}Expand description
A W3C Verifiable Credential 2.0 envelope binding a DPP passport to its signed payload.
The cryptographic proof is in SignedCredential::jws; this struct provides
the structured VC context required for EUDI/EBSI interoperability.
Fields§
§context: Vec<String>§credential_type: Vec<String>§id: StringUnique credential ID (urn:uuid:…) — generated fresh per signing call.
issuer: StringDID of the signing issuer (did:web:…).
valid_from: DateTime<Utc>Credential issuance timestamp (W3C VC 2.0 validFrom).
credential_subject: PassportCredentialSubjectImplementations§
Source§impl PassportCredential
impl PassportCredential
Sourcepub const VC_BASE_CONTEXT: &'static str = "https://www.w3.org/ns/credentials/v2"
pub const VC_BASE_CONTEXT: &'static str = "https://www.w3.org/ns/credentials/v2"
W3C VCDM v2 base context — MUST be the first @context entry.
Sourcepub const PASSPORT_CONTEXT: &'static str = "https://schema.odal-node.io/credentials/dpp-passport/v1"
pub const PASSPORT_CONTEXT: &'static str = "https://schema.odal-node.io/credentials/dpp-passport/v1"
Project-specific JSON-LD context for DPP passport credentials.
Sourcepub fn new(
issuer: String,
credential_subject: PassportCredentialSubject,
) -> PassportCredential
pub fn new( issuer: String, credential_subject: PassportCredentialSubject, ) -> PassportCredential
Construct a passport credential with the VCDM v2 base context and the
VerifiableCredential base type guaranteed present, so a caller cannot
emit a VC missing https://www.w3.org/ns/credentials/v2. id
(urn:uuid: v7) and valid_from are generated fresh.
Trait Implementations§
Source§impl Clone for PassportCredential
impl Clone for PassportCredential
Source§fn clone(&self) -> PassportCredential
fn clone(&self) -> PassportCredential
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more