50 Commits

Author SHA1 Message Date
Vasco Santos
b2ee34295b
feat: has inline public key method (#132) 2020-09-23 19:07:28 +02:00
Alex Potsides
d16ce9c2ac
fix: replace node buffers with uint8arrays (#127)
* fix: replace node buffers with uint8arrays

Replaces all uses of node Buffers with Uint8Arrays

BREAKING CHANGES:

- Where node Buffers were returned, now Uint8Arrays are

* chore: remove gh dep
2020-08-07 17:36:22 +02:00
Hugo Dias
c305c36b26
fix: add buffer (#120)
related to this https://github.com/ipfs/js-ipfs/issues/2924
2020-03-18 17:33:29 +01:00
Alex Potsides
f44645ef7e
fix: remove use of assert module (#117)
The polyfill is big, we can simulate it by throwing an Error and it doesn't work under React Native.
2020-02-18 08:42:39 -05:00
Jacob Heun
65e0b746a5 fix: catch errors thrown by multihash decode (#109) 2019-12-18 10:17:59 +00:00
Jacob Heun
bbf0416f08 feat: deprecate isEqual in favor of equals (#107) 2019-11-12 15:00:11 +01:00
Marcin Rataj
544ca7d74b feat: support Peer ID represented as CID (#105)
* feat: support Peer ID represented as CID

This change adds two functions:

- createFromCID accepts CID as String|CID|Buffer
  and creates PeerId from the multihash value inside of it
- toCIDString serializes PeerId multihash into a CIDv1 in Base32,
  as agreed in https://github.com/libp2p/specs/pull/209

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>

* refactor: rename toCIDString to toString

CIDv1 is self describing, and toString was not defined.
Makes sense to use generic toString in this case.

This change also:
- remembers string with CID, so it is lazily generated only once
- switches createFromB58String to createFromCID (b58 is CIDv0),
  making it easier to migrate existing codebases.

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>

* docs: comment tests

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>

* feat: validate CID multicodec

- require CID with 'libp2p-key' (CIDv1) or 'dag-pb' (CIDv0 converted to CIDv1)
- delegate CID validation to CID constructor

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2019-11-04 18:22:29 +01:00
Topper Bowers
f39fb24321 feat: allow nested PeerIds to support pubKey function when using identity encoding (#101) 2019-09-25 15:39:24 +02:00
Vasco Santos
911aa634d3
chore: lead maintainer update (#98) 2019-07-30 21:17:24 +02:00
Maciej Krüger
76864184da feat: add compact protobuf format (#76)
* docs: document .createFromProtobuf and .marshal
* fix: lint
* test: verify .marshal() does it's job
2019-07-12 18:35:46 +01:00
Arve Knudsen
17440a3f9a feat(peerid): support creating from secp256k1; harmonize algo with Go (#95) 2019-07-11 20:31:39 +01:00
Henrique Dias
c3463c7421 feat: async await (#87)
BREAKING CHANGE: API refactored to use async/await
2019-07-11 18:09:21 +01:00
Hugo Dias
cd2099305e fix: clean repo and bundle size reduction 2019-01-09 15:03:49 +00:00
Vasco Santos
2e5e666140 fix: add peerIdWithIs to the API functions using the instance 2018-10-17 10:51:42 +01:00
Vasco Santos
6513a02e1e feat: add class-is module 2018-10-04 11:29:31 +01:00
Michael Garvin
e8ab1b9281 feat: change toPrint output to match go implementation 2018-07-02 19:26:03 +02:00
Maciej Krüger
156911e162 fix: catch error when unmarshaling instead of crashing (#72) 2017-12-01 08:49:50 +00:00
Yahya
3abdcdabbb fix: Always add public key to constructor if possible, Fix for undefined pubKey in remote peers (#68)
* Always add public key to constructor if possible

* extending Non-default # of bits test time, travis took 59521ms

License: MIT
Signed-off-by: Yahya <ya7yaz@gmail.com>
2017-10-12 10:09:18 +02:00
Friedel Ziegelmayer
d7088d6650 feat(deps): update aegir and libp2p-crypto (#67) 2017-09-07 14:50:44 +01:00
David Dias
442df13a11 feat: use next libp2p-crypto (#64)
* feat: use next libp2p-crypto

* chore: update deps
2017-07-22 13:37:01 -07:00
David Dias
ac27907241 feat: set privKey pubKey 2017-04-02 22:47:44 -04:00
David Dias
3f4f670691 feat: isEqual 2017-03-30 09:47:11 +01:00
David Dias
a3fe1a2f03 fix: avoid using constructor.name 2017-03-27 13:58:21 +01:00
David Dias
0acc572fd3 feat: isPeerId 2017-03-27 13:23:18 +01:00
Friedel Ziegelmayer
78d96d0b14 feat: create b58 string on creation and throw on id mutation 2016-12-18 09:02:37 +01:00
Friedel Ziegelmayer
bebb0a7eae feat: cache b58 id 2016-12-14 09:05:07 +01:00
Friedel Ziegelmayer
31701e236d Async Crypto Endeavour (#33)
* refactor: make import and creation async - This allows the use of native key generation in the browser

BREAKING CHANGE:

This changes the interface of .create, .createFromPrivKey,
.createFromPubKey, .createFromJSON
2016-11-03 07:51:29 +00:00
dignifiedquire
58f1933980 fix: code review and docs and go interop 2016-05-24 14:03:31 +02:00
dignifiedquire
4beb1f8888 refactor: use libp2p and standardized rsa keys 2016-05-23 22:06:25 +02:00
David Dias
b358530dfb add toJSON and fromJSOn and cli to quickly generate 2016-05-23 15:25:30 +01:00
David Dias
4afbedb525 update dependencies 2016-05-23 14:16:30 +01:00
dignifiedquire
ab76788771 Use dignified.js 2016-03-22 17:01:46 +01:00
Stephen Whitmore
727355c4f5 exposes opts + bits 2016-03-14 17:10:02 -07:00
David Dias
d4c3de1ecb codestyle 2016-03-10 19:43:23 +00:00
nginnever
ca9cef6de7 comparing buffers 2016-03-10 11:25:59 -08:00
nginnever
f55eebcef7 buffer the public key for consistency 2016-03-10 10:32:48 -08:00
David Dias
59b89039b6 came to fix a square bracket, ended up touch a bunch of other things :) 2016-03-03 17:31:33 +00:00
David Dias
845bd088fe add coverage, fix codestyle 2016-02-14 07:32:09 +00:00
nginnever
effa21b892 removed node forge bundle comment 2016-02-13 13:46:33 -08:00
nginnever
1a336f9289 cleanup changes 2016-02-12 19:55:44 -08:00
nginnever
58fe038e07 time out increased 2016-02-12 16:13:09 -08:00
nginnever
7ae9be8f71 new tests 2016-02-12 14:55:05 -08:00
nginnever
16c77433f9 getting ready to rewrite tests 2016-02-10 13:55:59 -08:00
nginnever
6ce01ab434 keys now generated and derived match with go client 2016-02-04 12:02:18 -08:00
David Dias
5cb511c646 added create id from private key 2016-02-04 12:01:58 -08:00
David Dias
3c0c9a3b19 tests and browser tests setup 2015-11-05 18:46:02 +00:00
David Dias
d7ab4bd8fb complement readme 2015-11-05 17:47:44 +00:00
David Dias
9aee5bf670 abandon ECD for RSA, in order to conform with go impl 2015-11-05 17:35:23 +00:00
David Dias
a0dbc2ced8 fix args order 2015-07-17 08:14:44 -07:00
David Dias
a499c5129a Initial Commit 2015-07-08 14:51:49 -07:00