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:
@@ -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())
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user