iron-ecdsa-rdfc-2019

Data Integrity ECDSA RDFC 2019 Cryptosuite

APACHE-2.0 License

Stars
1

Iron ECDSA-RDFC-2019 Cryptosuite

An implementation of the W3C Data Integrity ECDSA-RDFC-2019 Cryptosuite in Java.

Features

Installation

Maven

<dependency>
    <groupId>com.apicatalog</groupId>
    <artifactId>iron-ecdsa-rdfc-2019</artifactId>
    <version>0.14.0</version>
</dependency>

<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-ecdsa-rdfc-2019-jre8:0.14.0")
implementation("com.apicatalog:iron-verifiable-credentials-jre8:0.14.0")

Usage

Verifier

// create a new verifier instance
static Verifier VERIFIER = Verifier.with(new ECDSASignature2019())
    // options
    .loader(...)
    .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 signature suite static instance
static SignatureSuite SUITE = new ECDSASignature2019();

// create a new issuer instance
Issuer ISSUER = SUITE.createIssuer(keyPairProvider)
  // options
  .loader(...);
    
try {
  // create a new proof draft using P-256
  var proofDraft = SUITE.createP256Draft(verificationMethod, purpose);
  // or P-384
  var proofDraft = SUITE.createP384Draft(verificationMethod, purpose);
  
  // set custom options
  proofDraft.created(...);
  proofDraft.domain(...);
  ...

  // 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) {
  ...
}

Documentation

Contributing

All PR's welcome!

Building

Fork and clone the project repository.

> cd iron-ecdsa-rdfc-2019
> mvn clean package

Resources

Sponsors

Commercial Support

Commercial support is available at [email protected]