* 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>
* perf: remove asn1.js from rsa
* fix: tweaks
* fix: it works, but I do not know 100% why
* chore: remove asn1.js
* fix: ensure jwk params encoded as uint
* fix: util tests
* fix: zero pad base64urlToBuffer
* fix: more zero pad
* test: add round trip test
* test: base64url to Buffer with padding
These 2 unused functions required us to import the whole of the node-forge PKI implementation when we only use some RSA stuffs.
BREAKING CHANGE: removes unused jwk2pem methods `jwk2pubPem` and `jwk2privPem`. These methods are not being used in any js libp2p modules, so only users referencing these directly will be impacted.
BREAKING CHANGE: getRandomValues method exported from src/keys/rsa-browser.js and src/keys/rsa.js signature has changed from accepting an array to a number for random byte length
* fix: avoid sync callback in async function
* chore: fix linting
* chore: remove non jenkins ci
* refactor: use nextTick over setImmediate
* refactor: async/nextTick for better browser support
* 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
Implement generateKeyPairFromSeed for ed25519 - this will produce the same keypair for the same seed (or first 32 bytes of reader) as given to GenerateKeyPairWithReader in go-libp2p.