Skip to content

Commit

Permalink
Merge pull request #184 from dajiaji/bump-to_0_19_0
Browse files Browse the repository at this point in the history
Bump version up to 0.19.0.
  • Loading branch information
dajiaji authored Jul 17, 2023
2 parents 04ffeaa + 26422bb commit 09a53bf
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 14 deletions.
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changes

## Version 0.19.0

Released 2023-07-17

- [(#183) Add support for importKey('jwk').](https://github.com/dajiaji/hpke-js/pull/183)
- [(#181) Adopt noble-ciphers insterad of standardlib for ChaCha20/Poly1305.](https://github.com/dajiaji/hpke-js/pull/181)
- [(#178) Merge import-map into deno.json.](https://github.com/dajiaji/hpke-js/pull/178)
- Update dev dependencies:
- [(#180) Bump @playwright/test to 1.36.1.](https://github.com/dajiaji/hpke-js/pull/180)

## Version 0.18.5

Released 2023-06-13
Expand Down
49 changes: 40 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Using esm.sh:
```html
<!-- use a specific version -->
<script type="module">
import * as hpke from "https://esm.sh/hpke-js@0.18.5";
import * as hpke from "https://esm.sh/hpke-js@0.19.0";
// ...
</script>

Expand All @@ -140,7 +140,7 @@ Using unpkg:
```html
<!-- use a specific version -->
<script type="module">
import * as hpke from "https://unpkg.com/hpke-js@0.18.5/esm/mod.js";
import * as hpke from "https://unpkg.com/hpke-js@0.19.0/esm/mod.js";
// ...
</script>
```
Expand All @@ -165,7 +165,7 @@ Using deno.land:

```js
// use a specific version
import * as hpke from "https://deno.land/x/hpke@0.18.5/mod.ts";
import * as hpke from "https://deno.land/x/hpke@0.19.0/mod.ts";

// use the latest stable version
import * as hpke from "https://deno.land/x/hpke/mod.ts";
Expand All @@ -176,15 +176,15 @@ import * as hpke from "https://deno.land/x/hpke/mod.ts";
Downloads a single js file from esm.sh:

```sh
curl -sS -o $YOUR_SRC_PATH/hpke.js https://esm.sh/v86/hpke-js@0.18.5/es2022/hpke-js.js
curl -sS -o $YOUR_SRC_PATH/hpke.js https://esm.sh/v86/hpke-js@0.19.0/es2022/hpke-js.js
# if you want to use a minified version:
curl -sS -o $YOUR_SRC_PATH/hpke.min.js https://esm.sh/v86/hpke-js@0.18.5/es2022/hpke.min.js
curl -sS -o $YOUR_SRC_PATH/hpke.min.js https://esm.sh/v86/hpke-js@0.19.0/es2022/hpke.min.js
```

Emits a single js file by using `deno bundle`:

```sh
deno bundle https://deno.land/x/hpke@0.18.5/mod.ts > $YOUR_SRC_PATH/hpke.js
deno bundle https://deno.land/x/hpke@0.19.0/mod.ts > $YOUR_SRC_PATH/hpke.js
```

## Usage
Expand All @@ -200,8 +200,8 @@ Browsers:
<head></head>
<body>
<script type="module">
// import * as hpke from "https://esm.sh/hpke-js@0.18.5";
import { Kem, Kdf, Aead, CipherSuite } from "https://esm.sh/hpke-js@0.18.5";
// import * as hpke from "https://esm.sh/hpke-js@0.19.0";
import { Kem, Kdf, Aead, CipherSuite } from "https://esm.sh/hpke-js@0.19.0";
globalThis.doHpke = async () => {
Expand All @@ -217,10 +217,41 @@ Browsers:
recipientPublicKey: rkp.publicKey
});
// A JWK-formatted recipient public key can also be used.
// const jwkPkR = {
// kty: "EC",
// crv: "P-256",
// kid: "P-256-01",
// x: "-eZXC6nV-xgthy8zZMCN8pcYSeE2XfWWqckA2fsxHPc",
// y: "BGU5soLgsu_y7GN2I3EPUXS9EZ7Sw0qif-V70JtInFI",
// key_ops: [],
// };
// const pkR = await suite.importKey("jwk", jwkPkR, true);
// const sender = await suite.createSenderContext({
// recipientPublicKey: pkR,
// });
const recipient = await suite.createRecipientContext({
recipientKey: rkp.privateKey, // rkp (CryptoKeyPair) is also acceptable.
enc: sender.enc,
});
// A JWK-formatted recipient private key can also be used.
// const jwkSkR = {
// kty: "EC",
// crv: "P-256",
// kid: "P-256-01",
// x: "-eZXC6nV-xgthy8zZMCN8pcYSeE2XfWWqckA2fsxHPc",
// y: "BGU5soLgsu_y7GN2I3EPUXS9EZ7Sw0qif-V70JtInFI",
// d: "kwibx3gas6Kz1V2fyQHKSnr-ybflddSjN0eOnbmLmyo",
// key_ops: ["deriveBits"],
// };
// const skR = await suite.importKey("jwk", jwkSkR, false);
// const recipient = await suite.createRecipientContext({
// recipientKey: skR,
// enc: sender.enc,
// });
// encrypt
const ct = await sender.seal(new TextEncoder().encode("hello world!"));
Expand Down Expand Up @@ -286,7 +317,7 @@ doHpke();
Deno:

```js
import { Kem, Kdf, Aead, CipherSuite } from "https://deno.land/x/hpke@0.18.5/mod.ts";
import { Kem, Kdf, Aead, CipherSuite } from "https://deno.land/x/hpke@0.19.0/mod.ts";

async function doHpke() {
// setup
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

| Version | Supported |
| ------- | ------------------ |
| 0.18.x | :white_check_mark: |
| < 0.18 | :x: |
| 0.19.x | :white_check_mark: |
| < 0.19 | :x: |

## Reporting a Vulnerability

Expand Down
89 changes: 88 additions & 1 deletion deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion samples/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"author": "Ajitomi Daisuke <ajitomi@gmail.com> (https://github.com/dajiaji)",
"license": "MIT",
"dependencies": {
"hpke-js": "^0.18.5"
"hpke-js": "^0.19.0"
}
}
2 changes: 1 addition & 1 deletion samples/ts-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"author": "Ajitomi Daisuke <ajitomi@gmail.com> (https://github.com/dajiaji)",
"license": "MIT",
"dependencies": {
"hpke-js": "^0.18.5",
"hpke-js": "^0.19.0",
"ts-node": "^10.7.0"
}
}

0 comments on commit 09a53bf

Please sign in to comment.