mirror of
https://github.com/fluencelabs/js-peer-id
synced 2025-06-28 22:31:47 +00:00
feat: allow nested PeerIds to support pubKey function when using identity encoding (#101)
This commit is contained in:
committed by
Vasco Santos
parent
911aa634d3
commit
f39fb24321
@ -48,6 +48,13 @@ class PeerId {
|
||||
if (this._privKey) {
|
||||
return this._privKey.public
|
||||
}
|
||||
|
||||
const decoded = mh.decode(this.id)
|
||||
|
||||
if (decoded.name === 'identity') {
|
||||
this._pubKey = cryptoKeys.unmarshalPublicKey(decoded.digest)
|
||||
return this._pubKey
|
||||
}
|
||||
}
|
||||
|
||||
set pubKey (pubKey) {
|
||||
|
Reference in New Issue
Block a user