项目作者: transmute-industries

项目描述 :
JSON-LD Signature Starter Kit
高级语言: JavaScript
项目地址: git://github.com/transmute-industries/linked-data-signature-starter-kit.git
创建时间: 2019-09-26T14:32:55Z
项目社区:https://github.com/transmute-industries/linked-data-signature-starter-kit

开源协议:Apache License 2.0

下载


Linked Data Signature Starter Kit

The purpose of this repo is to provide a starting point for developers wishing to implement JSON-LD Signatures.

Getting Started

  1. npm i
  2. npm run test
  3. npm run coverage

You will need to implement 2 classes to create new JSON-LD Signature.

First, the LinkedDataKeyClass, we provide an example MyLinkedDataKeyClass2019 that provides support for JOSE keys.

This class must support sign and verify interfaces, and SHOULD handle encoding of both key formats and signatures.

Second, the LinkedDataSignature, we provide an example MyLinkedDataSignature2019 that supports creating JWS / JWK based JSON-LD Signatures.

A JSON-LD Signature has a verification key type, and a signature/proof type for example:

  • MyJwsVerificationKey2019
  • MyLinkedDataSignature2019

You must provide both a json-ld context, and human readable documentation for every property you create for your signature suite.

In this case, we define these verification key and proof formats, as well as the publicKeyJwk property.

You can read the documentation here:

https://transmute-industries.github.io/linked-data-signature-starter-kit/

And the context:

https://transmute-industries.github.io/linked-data-signature-starter-kit/contexts/linked-data-signature-starter-kit-v0.0.jsonld

You MUST always version context files, and MUST ensure they remain resolvable at their published path once they are in use.

Failure to do so is similar to not maintaining an npm module, or unpublishing a module that may be used by others. If you are not sure if you can maintain a JSON-LD context, its best that you not create one, or rely on github / community structures to ensure that the context can easily be updated.

License

These examples are meant to be used with https://github.com/digitalbazaar/jsonld-signatures

I’ve pulled some of the interface machinery from their implementation, in order to try and provide a more black box interface for creating signature suites, but if you are an advanced user, I recommend you extend their base classes directly and not use this repo.