baseid-core
The foundation crate providing types used across all BaseID crates.
Installation
Section titled “Installation”[dependencies]baseid-core = "0.1.0-alpha.1"Key Types
Section titled “Key Types”| Type | Description |
|---|---|
KeyType | Ed25519, P256, P384, Secp256k1 |
CredentialFormat | W3cVc, Mdl, SdJwtVc, AnonCreds, Bbs |
CredentialId | Unique credential identifier |
AssuranceLevel | Low, Substantial, High |
AssuranceFramework | Pctf, Eidas, Nist80063, Tdif |
Language | En, Fr, De, Es, It, Ar, and more |
Bilingual Errors
Section titled “Bilingual Errors”All BaseID errors implement BilingualError:
use baseid_core::error::BilingualError;use baseid_core::language::Language;
let error = some_operation().unwrap_err();println!("EN: {}", error.message(Language::En));println!("FR: {}", error.message(Language::Fr));This is a core requirement for Canadian government deployments where both official languages must be supported.
Lifecycle Traits
Section titled “Lifecycle Traits”The credential lifecycle is modeled with three traits:
pub trait CredentialIssuer { fn issue(&self, request: &IssuanceRequest) -> Result<IssuedCredential>;}
pub trait CredentialVerifier { fn verify(&self, credential: &[u8]) -> Result<VerifiedClaims>;}
pub trait CredentialPresenter { fn present(&self, request: &PresentationRequest) -> Result<Presentation>;}Each credential format crate implements these traits.
ClaimSet
Section titled “ClaimSet”A namespace-keyed data structure for credential claims:
use baseid_core::claims::ClaimSet;
let mut claims = ClaimSet::new();claims.insert("org.iso.18013.5.1", "family_name", "Smith".into());claims.insert("org.iso.18013.5.1", "given_name", "Alice".into());