Skip to content

Commit a2e2b21

Browse files
Update README.md.
1 parent 6843a4b commit a2e2b21

File tree

1 file changed

+47
-40
lines changed

1 file changed

+47
-40
lines changed

README.md

Lines changed: 47 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,59 @@
1-
# JSON Object Signing and Encryption (JOSE)
1+
# JSON Object Signing and Encryption (JOSE) _(@solid/jose)_
22

3-
## Planned Features
3+
> Lightweight isomorphic JSON Object Signing and Encryption (JOSE) library for browser and Node.js
44
5-
- [x] Based on Webcrypto API
6-
- [ ] CryptoKey as expected key argument
7-
- [x] Isomorphic (Node.js and Browser)
8-
- [ ] Extensible JWT/JWS/JWE classes
5+
## Table of Contents
96

10-
## Dependencies
7+
- [Security](#security)
8+
- [Background](#background)
9+
- [Install](#install)
10+
- [Usage](#usage)
11+
- [License](#license)
1112

12-
This package is a work in progress, dependent on other ongoing projects. Code
13-
contained herein will be completed when the following dependencies are ready to
14-
release:
13+
## Security
1514

16-
- [anvilresearch/webcrypto](https://github.com/anvilresearch/webcrypto)
15+
TBD
1716

18-
The current contents of the repository should be considered a "sketch".
17+
## Background
1918

20-
## Scope of implementation
19+
- Based on Webcrypto API
20+
- Isomorphic (Node.js and Browser)
2121

22-
- [JWA][jwa]**RFC7518**
23-
- [ ] Cryptographic Algorithms for Digital Signatures and MACs
24-
- [ ] Cryptographic Algorithms for Key Management
25-
- [ ] Cryptographic Algorithms for Content Encryption
26-
- [JWK][jwk]**RFC7517**
27-
- [ ] JSON Web Key (JWK) Format
28-
- [ ] JWK Set Format
29-
- [ ] JSON Web Key (JWK) Thumbprint (RFC7638)
30-
- [ ] Conversion from JWK to PEM and PEM to JWK
31-
- [JWT][jwt]**RFC7519**
32-
- [JWS][jws]**RFC7515**
33-
- [JWE][jwe]**RFC7516**
22+
## Install
3423

35-
[jwa]: https://tools.ietf.org/html/rfc7518
36-
[jwk]: https://tools.ietf.org/html/rfc7517
37-
[jwt]: https://tools.ietf.org/html/rfc7519
38-
[jws]: https://tools.ietf.org/html/rfc7515
39-
[jwe]: https://tools.ietf.org/html/rfc7516
24+
Requires Node.js 8+.
4025

41-
## Usage in Browser
26+
```
27+
npm install @solid/jose
28+
```
29+
30+
## Usage
31+
32+
### Building with Webpack
33+
34+
**Important:**
35+
If you're using this library as a dependency and you plan to use Webpack, don't
36+
forget to add the following lines to your `webpack.config.js` `externals:`
37+
section:
38+
39+
```js
40+
externals: {
41+
'@sinonjs/text-encoding': 'TextEncoder',
42+
'isomorphic-webcrypto': 'crypto'
43+
}
44+
```
45+
46+
### In Node
4247

43-
If you `npm install jose` as a dependency, the Webpack'd minified bundle will be
48+
```js
49+
const { JWT } = require('@solid/jose')
50+
51+
const decoded = JWT.decode(data) // throws an error if invalid
52+
```
53+
54+
### In Browser
55+
56+
If you `npm install @solid/jose` as a dependency, the Webpack'd minified bundle will be
4457
available in the `dist/` directory as `jose.min.js`.
4558

4659
If you're actively developing/testing this lib, you can `npm run dist`, and the
@@ -69,21 +82,15 @@ Sample usage of JOSE lib in a browser.
6982
</html>
7083
```
7184

72-
## Running tests
85+
## Testing
7386

7487
### Nodejs
7588

7689
```bash
7790
$ npm test
7891
```
7992

80-
### Browser (karma)
81-
82-
```bash
83-
$ npm run karma
84-
```
85-
86-
## MIT License
93+
## License
8794

8895
[The MIT License](LICENSE.md)
8996

0 commit comments

Comments
 (0)