libp2p/js-libp2p-crypto

Key Conversion

開放

#177 建立於 2020年6月9日

 (0 則留言) (0 個反應) (0 位負責人)TypeScript (49 個分叉)auto 404
help wantedkind/enhancementstatus/ready

倉庫指標

星標
 (79 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

This library appears to have support for RSA, Ed25519 and Secp256k1 + NIST Curves.

When integrating with existing systems, developers are likely to encounter at least 3 formats for these keys...

hex / base58 / binary encoded keys, JWK and PEM.

AFAIK, PEM is already supported.

It would be useful to be able to convert between all popular formats using a friendly interface.

Here is a terrible example of handling this for secp256k1:

https://github.com/transmute-industries/did-key.js/blob/master/packages/did-key-secp256k1/src/keyUtils.test.ts

In addition, it might be desirable to support did:key within this library directly, because of its reliance on https://github.com/multiformats/multicodec/blob/master/table.csv#L81

https://github.com/w3c-ccg/did-method-key

This would allow for js-libp2p-crypto to be the single crypto dependency for systems like did:peer which upgrade from did:key: https://github.com/openssi/peer-did-method-spec

although support for did:key representations of js-libp2p-crypto might be better handled at another layer.

貢獻者指南