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
Labels
need/triage
Needs initial labeling and prioritization
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 APICryptoKey
it would be really appreciated!The text was updated successfully, but these errors were encountered: