SpruceKit
SpruceID
  • 🌲SpruceKit Introduction
    • Decentralized Identity Overview
    • Glossary
  • ⚡Quickstart
  • SpruceKit Mobile
    • SpruceKit Showcase App
      • Installation
      • Getting Started
      • Issue a Showcase Credential
      • Present a Showcase Credential
    • SpruceKit Mobile SDK
      • Introduction
      • Core Components
        • StorageManager
        • KeyManager
        • CredentialPack
        • Card
        • IsoMdlPresentation
        • mDocReader/IsomDLReader
        • Document Scanner
      • SpruceKit iOS SDK
        • Installation
        • Build a Wallet
          • Accept a W3C VC
          • Present a W3C VC
          • Present mDL in-person/offline
          • Present an mDL over the internet
        • Build a Verifier
          • Verify a W3C VC
          • Verify an mDL in-person/offline
          • Verify an mDL over the internet
      • SpruceKit Android SDK
        • Installation
        • Build a Wallet
          • Accept a W3C VC
          • Present a W3C VC
          • Present an mDL in-person/offline
          • Present an mDL over the internet
        • Build a Verifier
          • Verify a W3C VC
          • Verify an mDL in-person/offline
          • Verify an mDL over the internet
  • Verifiable Digital Credentials
    • ⚙️DIDKit
      • Installation
      • Core Concepts
      • DID Methods
      • Runtime Configuration
      • Specifications and Dependencies
      • Quickstart
      • DIDKit Packages
        • Command Line Interface
        • HTTP Server
        • Rust Crate
        • C Interface
        • Java and Android
        • Python
        • Javascript
      • DIDKit Examples
        • Core Functions (CLI)
        • Core Functions (HTTP)
        • did-web in minutes
        • Batch Generation & Verification
    • 🪪ISO mDL
      • Quickstart
      • Core Concepts
      • User Guide
  • Schema Definition Language
    • 🔗TreeLDR
      • TreeLDR Quickstart
        • First Schema
        • Compilation into JSON Schema
        • Compilation into JSON-LD Context
        • Writing a Layout
        • Simple Rust Integration
      • Types
        • Literal Types
      • Layouts
        • Primitive Layouts
        • Literal Layouts
        • Enumeration
        • Array Layout
        • References
      • Compiling
        • Schema Definition Formats
          • JSON Schema
          • JSON-LD Context
          • Resource Description Framework (RDF)
        • Programming Languages
          • Compiling to Rust
      • RDF Vocabulary
      • 💡TreeLDR Basics
        • Types and Layouts
        • Properties
        • Syntax
  • Witness for Credential Claims
    • 🔭Rebase
      • Core Library
      • Rust Client/Witness SDK
      • WASM Client SDK
      • Simple "Basic Post" Schema
      • DNS Witness Flow Schema
  • References
    • Contributing
    • Code of Conduct
Powered by GitBook
On this page

Was this helpful?

  1. SpruceKit Mobile
  2. SpruceKit Mobile SDK
  3. Core Components

mDocReader/IsomDLReader

PreviousIsoMdlPresentationNextDocument Scanner

Last updated 3 months ago

Was this helpful?

The MdocReader for and ISOmDLReader for lets you manage an 18013-5 interaction from the Verifier perspective.

// instantiate an mDocReader

let mdocReader = MDocReaderView(
// Set the scanned value
                uri: scanned!,
// Define the items you want to query by namespace, attribute_name and intent to retain:
                requestedItems: ["org.iso.18013.5.1": ["given_name": true]],
// Enter an array of issuer certificates that you accept (e.g. a list of certificates from US states).
// These issuer certificates should follow the IACA profile as defined in ISO/IEC 18013-5 Annex B. 
                trustAnchorRegistry: [<issuer_cert>],
// Implment your onCancel Behaviour
                onCancel: onCancel,
                path: $path
            )
            
let result = try mdocReader.handleResponse(response: <bytes>)

val context = LocalContext.current
// Instantiate an mDocReader
val reader = IsoMdlReader(
// Your implementation of the BLESessionStateDelegate
                <bleCallback>,
// The scanned value
                <content>,
// Elements to request
                <elements>,
// Enter an array of issuer certificates that you accept (e.g. a list of certificates from US states).
// These issuer certificates should follow the IACA profile as defined in ISO/IEC 18013-5 Annex B. 
                trustAnchorCerts,
// BLE connection
                bluetooth,
// Application context
                context
            )
            
// Then handle a Response
let response = try reader.handleResponse(response: <bytes>)

iOS
Android