baseid_core/
credential.rs

1//! Credential format-agnostic abstractions.
2
3use serde::{Deserialize, Serialize};
4
5use crate::types::{CredentialFormat, CredentialId, DateTime, Uri};
6
7/// Metadata common to all credential formats.
8#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct CredentialMetadata {
10    /// Local identifier for this credential.
11    pub id: CredentialId,
12    /// The format of this credential.
13    pub format: CredentialFormat,
14    /// Issuer identifier (typically a DID).
15    pub issuer: Uri,
16    /// Date the credential was issued.
17    pub issuance_date: DateTime,
18    /// Optional expiration date.
19    pub expiration_date: Option<DateTime>,
20}
21
22/// Summary of a stored credential, for listing without full deserialization.
23#[derive(Debug, Clone, Serialize, Deserialize)]
24pub struct CredentialSummary {
25    pub metadata: CredentialMetadata,
26    /// Human-readable label for the credential.
27    pub label: String,
28}