Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Provide toJWK (or toCrypto) method for easy Browser usage #194

Open
Zaba505 opened this issue Jul 21, 2021 · 0 comments
Open

Provide toJWK (or toCrypto) method for easy Browser usage #194

Zaba505 opened this issue Jul 21, 2021 · 0 comments
Labels
need/triage Needs initial labeling and prioritization

Comments

@Zaba505
Copy link

Zaba505 commented Jul 21, 2021

I'm currently working on an application where I need an actual Web API CryptoKey but in my attempts I couldn't easily convert a peers pub/priv key to it. It's probably worth noting that this is using RSA keys. After doing a simple console.log(peerId.privKey), I found it contains a field _key (its JWK representation), which is my current workaround. I'm unsure if an API to provide this hasn't been added due to either incompatibility with NodeJS or inconsistent runtime representation of various keys (RSA, EC, etc.) but it does make working with non-libp2p libraries quite challenging (e.g. jose is my particular use case).

I have looked at #190 and #177 but neither seemed to provide alternatives/workarounds for the time being so I decided to open this issue to either find a solution I missed or spur up discussion on adding a new method. If anyone does have a better way of converting a libp2p-crypto key to a Web API CryptoKey it would be really appreciated!

@lidel lidel added the need/triage Needs initial labeling and prioritization label Oct 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

2 participants