Skip to content

Commit

Permalink
chore!: Update multiformats, add JWS utilities, update deps (#1)
Browse files Browse the repository at this point in the history
* chore!: update to latest IPLD & multiformats stack

* feat: add JWS utils, docs, update deps, fix lint errors

* fix: typos in docs

* chore: bump semver-major
  • Loading branch information
rvagg committed May 31, 2021
1 parent 458bcde commit 3c22ab3
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 7,766 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# dag-jose-utils


This library provides utilities for using the dag-jose ipld codec. It uses dag-cbor to encode payloads and cleartexts to CIDs.

This library provides utilities for using the [DAG-JOSE](https://github.com/ceramicnetwork/js-dag-jose) IPLD codec. It uses [DAG-CBOR](https://github.com/ipld/js-dag-cbor) to encode payloads and cleartexts to CIDs.

## Installation
First install the package
Expand All @@ -17,7 +15,9 @@ import {
prepareCleartext,
decodeCleartext,
encodeIdentityCID,
decodeIdentityCID
decodeIdentityCID,
toJWSPayload,
toJWSStrings
} from 'dag-jose-utils'
```

Expand Down Expand Up @@ -46,10 +46,14 @@ Encode an ipld object as a CID that uses the identity hash.
### decodeIdentityCID(cid: CID): Record<string, any>
Decode an ipld object from a CID that uses the identity hash.

### toJWSPayload(payload: EncodedPayload | CID): string
Transform an `EncodedPayload` (from `encodePayload()`) or a CID into a JWS string for use with `createJWS()` in [did-jwt](https://github.com/decentralized-identity/did-jwt). The string form is simply the Base64url encoded form of the CID's byte representation.

### toJWSStrings(jose: any): string[]
Transform a `DagJWS` object from ipld-dag-jose into an array of strings for each signature in the object. The strings can then be verified using `verifyJWS()` in [did-jwt](https://github.com/decentralized-identity/did-jwt).

## Maintainer
[Joel Thorstensson](https://github.com/oed)


## License
MIT or APACHE
Loading

0 comments on commit 3c22ab3

Please sign in to comment.