Skip to content

Commit

Permalink
fixes get and decrypt api
Browse files Browse the repository at this point in the history
  • Loading branch information
arch1995 committed Feb 29, 2024
1 parent 87b6cd8 commit 91dfcf3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/webAuthnShareResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export async function decryptData<T>(privKeyHex: string, d: string): Promise<T>
}

export async function getAndDecryptData<T>(m: MetadataStorageLayer, privKeyHex: string, namespace: string): Promise<Record<string, T> | null> {
const keyPair = ec.keyFromPrivate(privKeyHex);
const keyPair = ec.keyFromPrivate(privKeyHex, "hex");
const pubKey = keyPair.getPublic();
const serializedData = await m.getMetadata({ pub_key_X: pubKey.getX().toString(16), pub_key_Y: pubKey.getY().toString(16) }, namespace);
const serializedData = await m.getMetadata({ pub_key_X: pubKey.getX().toString(16, 64), pub_key_Y: pubKey.getY().toString(16, 64) }, namespace);
if (!serializedData) {
return null;
}
Expand Down

0 comments on commit 91dfcf3

Please sign in to comment.