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
17 lines
392 B
TypeScript
17 lines
392 B
TypeScript
import { deserializerV1, pem2_P256key } from "../src/mod.ts";
|
|
|
|
const testAssetFolder = "./testdata"
|
|
|
|
|
|
|
|
Deno.test(async function testV1() {
|
|
|
|
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())
|
|
})
|