alan-turing-institute / trustchain

Trustworthy decentralised PKI
https://alan-turing-institute.github.io/trustchain/
Apache License 2.0
9 stars 4 forks source link

Add data credential signing & verification to the CLI #184

Open thobson88 opened 2 weeks ago

thobson88 commented 2 weeks ago

Closes #181.

Adds a new data subcommand to the CLI. This is similar to the vc subcommand, but instead for signing and verifying a credential for a data file.

Note that the SHA-256 hashing algorithm is used (implicitly) to compute the hash identifier for the dataset, e.g.:

  "credentialSubject": {
    "dataset": "03d3711e0ec7585fdf635535665c3d9e376d36c0f89024d30fa7587cd247f6b1"
  },

Ideally we should make this choice of hash function explicit, but it's unclear (to me) where this information belongs inside the credential.

(There are also some calls to unwrap() that need to be fixed before merging.)