-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add support for ed25519 and secp256k1 keys #3208
Conversation
@achingbrain there is currently no way to just specify a key type on initialization, however you can pass a pre generated privateKey as shown in the tests. We could add a await IPFS.create({ init: { keyType: 'ed25519' }}) go-ipfs uses |
I went with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Should it throw if you pass bits
and algorithm
is not 'rsa'
?
It could, ideally I think this would be a warning if anything. fwiw, the node crypto library ignores bits for ed keys. |
Closing this in favor of bundling with #3212 |
- add support for ed25519 and secp256k1 keys for the ipfs PeerId - add support for using ed25519 and secp256k1 keys with ipns - add support for keychain without a pass, this fixes several keychain commands - fix `name publish`, ttl should be optional but wasn't being allowed Includes changes in #3208 Key gen and key listing now works: ```sh $ jsipfs key gen --type=ed25519 my-ed-key generated QmUPJZ3ghsnkRVgYjrMrSC8MbbZTzcezn6mH7vY9vTbrMY my-ed-key $ jsipfs key list QmUPJZ3ghsnkRVgYjrMrSC8MbbZTzcezn6mH7vY9vTbrMY my-ed-key QmYPxJJb8Mpa6JjQj7hCTF4ajn2SE1HFLRoAnCbymTGzyC self ``` IPNS Publishing now works properly, including using other key types: ```sh jsipfs name publish -k my-ed-key /ipfs/QmP7WDyEdkFu2nfj35SUEB7fk3iKCHpcrCVbGk1HXZU22a Published to 12D3KooWGmSq6u3yZeXqeqSmQpJWKQGGdCxrZQAUZBzsbSM2kCE6: /ipfs/QmP7WDyEdkFu2nfj35SUEB7fk3iKCHpcrCVbGk1HXZU22a ``` I also fixed a couple of the example tests, they weren't waiting for IPFS to start before executing the tests, which could cause them to intermittently fail. BREAKING CHANGE: remove support for key.export over the http api
- add support for ed25519 and secp256k1 keys for the ipfs PeerId - add support for using ed25519 and secp256k1 keys with ipns - add support for keychain without a pass, this fixes several keychain commands - fix `name publish`, ttl should be optional but wasn't being allowed Includes changes in ipfs/js-ipfs#3208 Key gen and key listing now works: ```sh $ jsipfs key gen --type=ed25519 my-ed-key generated QmUPJZ3ghsnkRVgYjrMrSC8MbbZTzcezn6mH7vY9vTbrMY my-ed-key $ jsipfs key list QmUPJZ3ghsnkRVgYjrMrSC8MbbZTzcezn6mH7vY9vTbrMY my-ed-key QmYPxJJb8Mpa6JjQj7hCTF4ajn2SE1HFLRoAnCbymTGzyC self ``` IPNS Publishing now works properly, including using other key types: ```sh jsipfs name publish -k my-ed-key /ipfs/QmP7WDyEdkFu2nfj35SUEB7fk3iKCHpcrCVbGk1HXZU22a Published to 12D3KooWGmSq6u3yZeXqeqSmQpJWKQGGdCxrZQAUZBzsbSM2kCE6: /ipfs/QmP7WDyEdkFu2nfj35SUEB7fk3iKCHpcrCVbGk1HXZU22a ``` I also fixed a couple of the example tests, they weren't waiting for IPFS to start before executing the tests, which could cause them to intermittently fail. BREAKING CHANGE: remove support for key.export over the http api
- add support for ed25519 and secp256k1 keys for the ipfs PeerId - add support for using ed25519 and secp256k1 keys with ipns - add support for keychain without a pass, this fixes several keychain commands - fix `name publish`, ttl should be optional but wasn't being allowed Includes changes in ipfs/js-ipfs#3208 Key gen and key listing now works: ```sh $ jsipfs key gen --type=ed25519 my-ed-key generated QmUPJZ3ghsnkRVgYjrMrSC8MbbZTzcezn6mH7vY9vTbrMY my-ed-key $ jsipfs key list QmUPJZ3ghsnkRVgYjrMrSC8MbbZTzcezn6mH7vY9vTbrMY my-ed-key QmYPxJJb8Mpa6JjQj7hCTF4ajn2SE1HFLRoAnCbymTGzyC self ``` IPNS Publishing now works properly, including using other key types: ```sh jsipfs name publish -k my-ed-key /ipfs/QmP7WDyEdkFu2nfj35SUEB7fk3iKCHpcrCVbGk1HXZU22a Published to 12D3KooWGmSq6u3yZeXqeqSmQpJWKQGGdCxrZQAUZBzsbSM2kCE6: /ipfs/QmP7WDyEdkFu2nfj35SUEB7fk3iKCHpcrCVbGk1HXZU22a ``` I also fixed a couple of the example tests, they weren't waiting for IPFS to start before executing the tests, which could cause them to intermittently fail. BREAKING CHANGE: remove support for key.export over the http api
This adds support for:
fixes #2553