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
  • At a Glance
  • Installation
  • Syntax
  • Addition configuration
  • Examples

Was this helpful?

  1. Verifiable Digital Credentials
  2. DIDKit
  3. DIDKit Packages

Command Line Interface

PreviousDIDKit PackagesNextHTTP Server

Last updated 7 months ago

Was this helpful?

At a Glance

  • For setting up an HTTP server, whether for internal use, over the open internet, or both, we recommend using our dockerized HTTP server. Instructions .

  • Instructions for building manually can be found on the main .

  • See the section below for automation and testing building blocks.

Installation

Docker

The HTTP server is containerised and available under ghcr.io/spruceid/didkit-cli.

You can use the Docker image as a CLI:

docker run ghcr.io/spruceid/didkit-cli:latest --help

Note: You can pass JWKs either by sharing a volume with:

docker run --volume

or by passing the JWK directly with:

docker run -e JWK=$MY_JWK or docker run didkit-http --jwk $MY_JWK.

See the repo's Dockerfile for further details.

Syntax

Each command is called in the form: didkit help, didkit generate-ed25519-key, etc.

help

Output help about didkit and its subcommands.

generate-ed25519-key

key-to-did

key-to-verification-method

Options

  • -k, --key-path <file> (required, conflicts with jwk): Filename of JWK file

  • -j, --jwk <jwk> (required, conflicts with key-path): JWK.

vc-issue-credential

Options

  • -k, --key-path <key> (required, conflicts with jwk): Filename of JWK for signing.

  • -j, --jwk <jwk> (required, conflicts with key-path): JWK for signing.

  • RSA

  • OKP (curve: Ed25519)

vc-verify-credential

Verify a verifiable credential. Reads verifiable credentials on standard input, and outputs verification result. Returns exit status zero if credential successfully verified, or non-zero if errors were encountered.

Options

Supported proof types

Output

{"checks": [],"warnings": [],"errors": []}

Verification result properties:

  • checks - Array of strings indicating checks completed on the credential.

  • warnings - Array of warnings encountered during validation or verification.

  • errors - Array of strings indicating errors encountered during validation or verification. If errors is empty, the credential is verified.

vc-issue-presentation

Issue a verifiable presentation. Reads presentation on stdin, generates proof to add to it, and outputs the resulting verifiable presentation.

vc-verify-presentation

Verify a verifiable presentation. Reads verifiable presentation on stdin, and outputs verification result. Returns exit status zero if presentation successfully verified, or non-zero if errors were encountered.

Addition configuration

Outbound Proxy

You can set the environment variable HTTP_PROXY to have DIDKit use a proxy. Both HTTP and SOCKS protocols are supported. See the "proxies" section of the DIDKit docs for more details.

Examples

Tool
Example

Core CLI syntax

Batching, Automation

Generate a Ed25519 keypair and output it in .

Given a , output the corresponding . Currently, this only supports keys.

Given a Ed25519 , output the corresponding .

Issue a verifiable credential. Reads credential on stdin, constructs a to add to the credential, and outputs the resulting verifiable credential.

Corresponds to /issue/credentials in .

The proof type is set automatically based on the key file provided. JWK parameters besides the cryptographic components, such as (Key ID), are ignored currently. For an RSA key, the (Algorithm) parameter is ignored and RS256 is used for it, for .

Options besides --key-path correspond to linked data as specified in and .

-C, --challenge <challenge> - property of the proof

-c, --created <created> - property of the proof. ISO8601 datetime. Defaults to the current time.

-d, --domain <domain> - property of the proof

-p, --proof-purpose <proof-purpose> property of the proof.

-v, --verification-method <verification-method> property of the proof. URI for proof verification information, e.g. a public key identifier.

Supported

Corresponds to /verify/credentials in .

Options are linked data as specified in and . If there is more than one proof present, at least one must pass all the requirements passed in the options.

-C, --challenge <challenge> - The property of the proof must equal this value.

-c, --created <created> - The property of the proof must be on or after the given ISO8601 datetime. Defaults to the current time.

-d, --domain <domain> - The property of the proof must equal the given value.

-p, --proof-purpose <proof-purpose> - The property of the proof must equal this value.

-v, --verification-method <verification-method> - The property of the proof must equal this value.

The verification result output is a VerificationResult JSON object as specified in :

Corresponds to /prove/presentations in .

Options are the same as for .

Corresponds to /verify/presentations in .

Options and output format are the same as for .

⚙️
below
Installation page
Examples
JWK format
JWK
did:key
Ed25519
JWK
did:key
verificationMethod
linked data proof
vc-http-api
kid
alg
RsaSignature2018
proof options
ld-proofs
vc-http-api
challenge
created
domain
proofPurpose
verificationMethod
JWK key types
vc-http-api
proof options
ld-proofs
vc-http-api
challenge
created
domain
proofPurpose
verificationMethod
RsaSignature2018
Ed25519VerificationKey2018
vc-http-api
vc-http-api
vc-issue-credential
vc-http-api
vc-verify-credential
Example script
Example automation script