* Fix Ed25519 PeerID generation
This commit pushes further fixes to the generation of Ed25519 peer IDs,
building upon the discussion in ipfs/js-ipfs#3591 and the subsequent
pull request libp2p/js-libp2p-crypto#185.
The purpose of this new pull request is to harmonize the encoding of
PeerIDs for Ed25519 keys such that the same new format is used
everywhere: peer IDs when assigned upon key generation, peer IDs when
shown via key listing, as well as the peer IDs displayed as IPNS names
when the key is used as the basis for an IPNS record.
Concretely, this changes the peer ID representation of Ed25519 keys from
the `Qm...` format to the newer `1...` format.
The accompanying test has been modified accordingly.
* Satisfy linter
* fix: replace node buffers with uint8arrays
All usage of node buffers have been replaced with uint8arrays.
BREAKING CHANGES:
- Where node Buffers were returned, now Uint8Arrays are
* chore: remove commented code
* feat: add exporting/importing of ed25519 keys in libp2p-key format
* feat: add libp2p-key export/import support for rsa and secp keys
* chore: dep bumps
* chore: update aegir
* refactor: import and export base64 strings
* refactor: simplify api for now
* chore: fix lint
* refactor: remove extraneous param
* refactor: clean up
* fix: review patches
* fix: add buffer, cleanup, reduce size
- add buffer related to https://github.com/ipfs/js-ipfs/issues/2924
- remove unnecessary eslint ignore
- remove tweelnacl and use node-forge
- remove browserify-aes and use node-forge
- use multibase to encode b58
- require only sha256 from multihashing
- reduce bundle size
after all the deps here https://github.com/ipfs/js-ipfs/issues/2924 are merged libp2p-crypto will be able to be bundle with `node: false` 🎉
* fix: reduce bundle size
* fix: use new secp
* fix: bundle size
* chore: update secp
Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
* feat: export/import password protected RSA key
* docs: crypto.key.import
* test: import with wrong password
* fix: lint
* test: importing openssl keys
* just to trigger circle with new ubuntu
* feat: get the RSA key id
* feat: get the ED 25519 key id
* feat: pbkdf2
* fix(pbkdf2): base64 has more chars to guess than hex
* chore: update deps
* test: Add failing tests
* fix: Fix some failing tests
* fix: various fixes on garbage error handling and respective tests
* tests: increased timeout for test timing out in CI
* tests: increasing test timeout to please the CI gods
* tests: increasing test timeout to please the CI gods
* fix: for when unMarshallPrivateKey is called with null or undefined key