Skip to content

🐛 Key must be one of type CryptoKey, KeyObject, or Uint8Array error when using jose with react-native-quick-crypto #681

Open
@freiserg

Description

@freiserg

What's happening?

When using react-native-quick-crypto together with the jose library in a React Native app, calling exportJWK() throws the following error:

TypeError: Key must be one of type CryptoKey, KeyObject, or Uint8Array. Received an instance of CryptoKey

Reproducible Code

const { publicKey, privateKey } = await generateKeyPair('ES256', { extractable: true });

const publicKeyJwk = await exportJWK(publicKey);

Relevant log output

TypeError: Key must be one of type CryptoKey, KeyObject, or Uint8Array. Received an instance of CryptoKey

Device

iPhone 16

QuickCrypto Version

0.7.13

Can you reproduce this issue in the QuickCrypto Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions