libp2p / js-peer-id

peer-id implementation in JavaScript. Deprecated; use https://github.com/libp2p/js-libp2p-peer-id instead.
https://github.com/libp2p/js-libp2p-peer-id
MIT License
80 stars 44 forks source link

Add support for specifying keys #85

Closed jacobheun closed 4 years ago

jacobheun commented 5 years ago

libp2p-crypto already supports multiple key formats, this PR exposes that by adding the type option to .create. This will allow users to create the other key types more easily.

jacobheun commented 5 years ago

I am going to do some integration tests against libp2p and js-ipfs with the ed25519 key type and will report back once done.

jacobheun commented 5 years ago

I ran this through the js-libp2p and js-ipfs test suites. I also had the tests alternate the key type (rsa and ed25519) used so that nodes connecting to one another would have different key types.

Aside from a minor issue with the libp2p-websocket-star-rendezvous code not respecting the crypto verify api, everything passed successfully. The issue with the rendezvous code has been fixed.

This should be good to merge.

jacobheun commented 5 years ago

@pgte I rebased this off the latest release, let me know if there are any updates you need from me for this to be released.

blakebyrnes commented 5 years ago

@jacobheun there's a ticket in https://github.com/libp2p/js-libp2p-crypto-secp256k1 to support secp keys in the latest libp2p. You can't unmarshal private keys since the underlying signature changed in peerId (https://github.com/libp2p/js-libp2p-crypto-secp256k1/pulls). Is there any reason to keep secp256 in it's own package at this point? Isn't it directly included in libp2p crypto now? Apologies if this is the wrong place to discuss.

jacobheun commented 5 years ago

@blakebyrnes I created an issue at libp2p-crypto to discuss this https://github.com/libp2p/js-libp2p-crypto/issues/135, since it should probably happen there.

vasco-santos commented 4 years ago

Closing, as this was added on #95