Skip to content

filip26/iron-verifiable-credentials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Important

Please consider a donation to keep the project available and maintained as an open-source.

The common experience with open-source is that no one wants to pay for it, but they will happily use it for free.

Iron Verifiable Credentials Processor

An implementation of the W3C Verifiable Credentials model and processing in Java.

Java 17 CI Java 11 CI Codacy Badge Codacy Badge Maintainability Rating Maven Central License

Features

Community compatibility dashboard for Verifiable Credentials

Installation

Maven

Java 17+

<dependency>
    <groupId>com.apicatalog</groupId>
    <artifactId>iron-verifiable-credentials</artifactId>
    <version>0.14.0</version>
</dependency>

Gradle

Android 12+ (API Level >=31)

implementation("com.apicatalog:iron-verifiable-credentials-jre8:0.14.0")

Do you need to support an older Android version? Contact me

Usage

This repository provides common logic and primitives to easily implement a signature suite. It is intended to be used together with a suite, or suites, of your choice, e.g. ECDSA SD 2023. Read the suite(s) documentation for specifics.

Verifier

// create a new verifier instance
static Verifier VERIFIER = Verifier.with(SUITE1, SUITE2, ...)
    // options
    .base(...)
    .loader(...)
    .useBundledContexts(true|false)
    .statusValidator(...)
    .subjectValidator(...)
    // ...
    ; 

try {
  // verify the given input proof(s)
  var verifiable = VERIFIER.verify(credential|presentation);
  
  // or with runtime parameters e.g. domain, challenge, etc.
  var verifiable = VERIFIER.verify(credential|presentation, parameters);
  
  // get verified details
  verifiable.subject()
  verifiable.id()
  verifiable.type()
  // ...
  
} catch (VerificationError | DocumentError e) {
  ...
}

Issuer

// create a new issuer instance
Issuer ISSUER = SUITE.createIssuer(keyPairProvider)
    // options
    .base(...)
    .loader(...)
    .useBundledContexts(true|false)
    // ...
    ; 

try {
  // issue a new verifiable, i.e. sign the input and add a new proof
  var verifiable = ISSUER.sign(credential|presentation, proofDraft).compacted();
  
} catch (SigningError | DocumentError e) {
  ...
}

Holder

// create a new holder instance
static Holder HOLDER = Holder.with(SUITE1, SUITE2, ...)
    // options
    .base(...)
    .loader(...)
    .useBundledContexts(true|false)
    // ...
    ; 

try {
  // derive a new signed credentials disclosing selected claims only
  var verifiable = HOLDER.derive(credential, selectors).compacted();

} catch (SigningError | DocumentError e) {
  ...
}

Documentation

javadoc

Contributing

All PR's welcome!

Building

Fork and clone the project repository.

Java 17

> cd iron-verfiable-credentials
> mvn clean package

Java 11

> cd iron-verfiable-credentials
> mvn -f pom_jre11.xml clean package

Extensions

Resources

Sponsors

Commercial Support

Commercial support is available at [email protected]