V0.7.0 Arroyo Toad

Fixed a design flaw where we supposed we could find keys before reading part of the message by adding support for a method to grab the key at runtime
This commit is contained in:
Christian Risi
2024-12-14 11:51:28 +00:00
parent e6b1f8d5ea
commit 15bae1af19
12 changed files with 63 additions and 8 deletions

View File

@@ -1,11 +1,16 @@
import { deserializerV1, pem2_P256key } from "../src/mod.ts";
const testAssetFolder = "./testdata"
Deno.test(async function testV1() {
let msg = (await Deno.readFile("./Private/Message.bin")).buffer
let key = await pem2_P256key("./Private/public-key.pem")
let mgs = await deserializerV1(msg, key)
const _msg = (await Deno.readFile(`${testAssetFolder}/Message.bin`)).buffer
const mgs = await deserializerV1(_msg, async () => {
return await pem2_P256key(`${testAssetFolder}/public-key.pem`)
})
console.log(mgs.toString())
})