Closed panva closed 2 years ago
It's strange. My local tests are passed for Object
(JWK), Uint8Array
, Buffer
, and ArrayBuffer
It is strange indeed, in the case linked, Uint8Array
is used, but the OP has not responded with more details about their runtime either...
Feel free to close if you feel this falls on the OP's environment setup or is otherwise related to their usage.
Thanks for responding this quickly.
Here is a webcrypto-liner
example. It shows that importKey
works for Uint8Array
and ArrayBuffer
https://codesandbox.io/s/webcrypto-liner-scgkyj?file=/index.html
webcrypto-core
uses pvtsutils.BufferSource
. It must work with those types of buffers.
https://github.com/PeculiarVentures/pvtsutils/blob/master/test/buffer_source_converter.ts#L4
I'm going to close this issue
It must work with those types of buffers.
Well, clearly it fails for the OP. But I'm falling short on details and will to investigate myself.
@pshaddel, if you could provide steps to reproduce here.
It must work with those types of buffers.
Well, clearly it fails for the OP. But I'm falling short on details and will to investigate myself.
@pshaddel, if you could provide steps to reproduce here.
I'm using dgraph lambda functions
which are pieces of Javascript code that executes on web workers. I try to make an example that helps reproducing this error.
Hi @microshine the issue is not related to the package and I was able to get the result without any error. Thank you for your time.
SubtleCrypto.importKey()
keyData
argument is an ArrayBuffer, a TypedArray, a DataView, or a JSONWebKey object containing the key in the given format.Currently, when webcrypto-liner > webcrypto-core is used, Typed Arrays such as
Uint8Array
or node'sBuffer
cannot be imported.See https://github.com/panva/jose/discussions/363