1.1.0 • Published 8 months ago

@gaia-x/did-web-generator v1.1.0

Weekly downloads
-
License
EPL-2.0
Repository
gitlab
Last release
8 months ago

Gaia-X AISBL DID Generator Library

This library allows you to generate a ready to use DID.

It uses your certificate to generate it, and thus relies on several x509/crypto libraries to work.

Usage

import {createDidDocument} from '@gaia-x/did-web-generator'
//...
function getDid(){
    return createDidDocument("https://mycompanydomain.com", "x509Certificate.pem", myX509Cert)
}

will return a json object looking like this

{
  "@context": [
    "https://www.w3.org/ns/did/v1",
    "https://w3id.org/security/suites/jws-2020/v1"
  ],
  "id": "did:web:mycompanydomain.com",
  "verificationMethod": [
    {
      "@context": "https://w3c-ccg.github.io/lds-jws2020/contexts/v1/",
      "id": "did:web:mycompanydomain.com#X509-JWK2020",
      "type": "JsonWebKey2020",
      "controller": "did:web:mycompanydomain.com",
      "publicKeyJwk": {
        "kty": "RSA",
        "n": "...",
        "e": "AQAB",
        "alg": "RS384",
        "x5u": "http://mycompanydomain.com/.well-known/x509Certificate.pem"
      }
    }
  ],
  "assertionMethod": [
    "did:web:mycompanydomain.com#X509-JWK2020"
  ]
}

The DID creation process requires certificate analysis, we suggest you cache the result DID to avoid more computation

1.1.0

8 months ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.0-5

1 year ago

1.0.0-4

1 year ago

1.0.0-1

1 year ago

1.0.0-3

1 year ago

1.0.0-2

1 year ago

1.0.0-0

1 year ago