Closed oed closed 1 year ago
Interesting, I ran your code and it seems to be working:
stored key {
publicKey: CryptoKey {
type: 'public',
extractable: true,
algorithm: { name: 'ECDSA', namedCurve: 'P-256' },
usages: [ 'verify' ]
},
privateKey: CryptoKey {
type: 'private',
extractable: false,
algorithm: { name: 'ECDSA', namedCurve: 'P-256' },
usages: [ 'sign' ]
}
}
Key stored successfully
retrieved key {
publicKey: CryptoKey {
type: 'public',
extractable: true,
algorithm: { name: 'ECDSA', namedCurve: 'P-256' },
usages: [ 'verify' ]
},
privateKey: CryptoKey {
type: 'private',
extractable: false,
algorithm: { name: 'ECDSA', namedCurve: 'P-256' },
usages: [ 'sign' ]
}
}
Signature: 65b18018284eb4ead0b066f524fd89c636e4f2d50254700c052c6c6551f57b98c168c0cda50908790304dea0eb061a7bd302a722c4ed366c5f1c7a0e41373d75
I'm using Node.js version 18.17.0, what version are you using? And any other details of your environment, if that doesn't solve it?
I was using Node.js v16.17.0
.
Changed to v18.17.1
and it seems to work. Thanks!
I'm having some issues storing and retrieving CryptoKeys using
fake-indexeddb
in nodejs.The following code works in browser (tested in firefox), without the imports:
However, when I run this code in nodejs I get this error:
Obviously the specific error here matters less. As you can see the
stored key
andretrieved key
are very different.Am I doing something wrong or is this a bug/limitation with
fake-indexedb
?