diff --git a/index.html b/index.html index 42c52cd..1c5cf46 100644 --- a/index.html +++ b/index.html @@ -48,7 +48,7 @@ font-weight: bold;}.hljs-number, .hljs-literal, .hljs-variable, .hljs-template-v font-weight: bold;}.hljs-subst{font-weight: normal;}.hljs-type, .hljs-class .hljs-title{color: #458; font-weight: bold;}.hljs-tag, .hljs-name, .hljs-attribute{color: #000080; font-weight: normal;}.hljs-regexp, .hljs-link{color: #009926;}.hljs-symbol, .hljs-bullet{color: #990073;}.hljs-built_in, .hljs-builtin-name{color: #0086b3;}.hljs-meta{color: #999; -font-weight: bold;}.hljs-deletion{background: #fdd;}.hljs-addition{background: #dfd;}.hljs-emphasis{font-style: italic;}.hljs-strong{font-weight: bold;}
Name | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
id: string | Base58
+font-weight: bold;}.hljs-deletion{background: #fdd;}.hljs-addition{background: #dfd;}.hljs-emphasis{font-style: italic;}.hljs-strong{font-weight: bold;}PeerIdJsonParameters
|
A Peer ID is the SHA-256 multihash of a public key.
create(opts: Object?, callback: function (Error, PeerId))
Create a new PeerId
by generating a new public/private keypair.
create(opts: Object?, callback: function (Error, PeerId))
Create a new PeerId
by generating a new public/private keypair.
Name | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts: Object? | Configuration object. | ||||||||||||||||||||||||
opts.bits: number? (=2048) | How many bits to use for the RSA key generation. | ||||||||||||||||||||||||
callback: function (Error, PeerId) | Node.js style callback.
@@ -71,42 +71,42 @@ PeerId.create((err, idthrow err
}
console.log('id', JSON.stringify(id))
-})PeerId.createFromHexString
Creates a Peer ID from hex string representing the key's multihash. +})PeerId.createFromHexString
Creates a Peer ID from hex string representing the key's multihash. Parameters
ReturnsPeerId
-PeerId.createFromBytes
Creates a Peer ID from a buffer representing the key's multihash. +PeerId.createFromBytes
Creates a Peer ID from a buffer representing the key's multihash. Parameters
ReturnsPeerId
-PeerId.createFromB58String
Creates a Peer ID from a PeerId.createFromB58String
Creates a Peer ID from a Parameters
ReturnsPeerId
-PeerId.createFromPubKey
Creates a Peer ID from a buffer containing a public key. -PeerId.createFromPrivKey
Creates a Peer ID from a buffer containing a private key. +PeerId.createFromPubKey
Creates a Peer ID from a buffer containing a public key. +PeerId.createFromPrivKey
Creates a Peer ID from a buffer containing a private key. PeerId.createFromJSON
Import a Parameters
instanceconstructor
Parameters
PeerId.prototype.id
PeerId.prototype.privKey
The private key of this id, if it exists. -PeerId.prototype.pubKey
The private key of this id, if it exists. -PeerId.prototype.marshalPubKey
Create the protobuf version of the public key, + |
createFromJSON(obj: PeerIdJson, callback: function (Error, PeerId))
Import a PeerId
from a serialized JSON object.
Name | Description |
---|---|
obj: PeerIdJson |
constructor(id: Buffer, privKey: RSAPrivateKey?, pubKey: RSAPublickKey?)
Name | Description |
---|---|
id: Buffer | |
privKey: RSAPrivateKey? | |
pubKey: RSAPublickKey? |
id: Buffer
privKey: (RSAPrivateKey | undefined)
The private key of this id, if it exists.
+marshalPubKey(): Buffer
Create the protobuf version of the public key, matching go-ipfs formatting.
Buffer
The marshalled public key
Error
Failure
-marshalPrivKey(): Buffer
Create the protobuf version of the private key, +
toJSON(): PeerIdJson
Return the jsonified version of the key, matching the formatting +
toJSON(): PeerIdJson
Return the jsonified version of the key, matching the formatting of go-ipfs for its config file.