Returns a public key for the peer that is safe for verifying its signatures.
A supplied key must derive to the peer id, otherwise InvalidPublicKeyError
is thrown, even if the peer id embeds a key. With no supplied key the key
inlined in the peer id is returned, or InvalidPublicKeyError is thrown if
there is none. Malformed key bytes also throw InvalidPublicKeyError.
Returns a public key for the peer that is safe for verifying its signatures.
A supplied key must derive to the peer id, otherwise
InvalidPublicKeyErroris thrown, even if the peer id embeds a key. With no supplied key the key inlined in the peer id is returned, orInvalidPublicKeyErroris thrown if there is none. Malformed key bytes also throwInvalidPublicKeyError.