pub struct PassportCredential {
pub context: Vec<Value>,
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<Value>§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 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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PassportCredential
impl Debug for PassportCredential
Source§impl<'de> Deserialize<'de> for PassportCredential
impl<'de> Deserialize<'de> for PassportCredential
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PassportCredential, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PassportCredential, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for PassportCredential
impl Serialize for PassportCredential
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for PassportCredential
impl RefUnwindSafe for PassportCredential
impl Send for PassportCredential
impl Sync for PassportCredential
impl Unpin for PassportCredential
impl UnsafeUnpin for PassportCredential
impl UnwindSafe for PassportCredential
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