mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-26 15:31:34 +00:00
797 lines
40 KiB
HTML
797 lines
40 KiB
HTML
<!doctype html>
|
|
<html class="default no-js">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<title>Keychain | libp2p - v0.30.0-rc.1</title>
|
|
<meta name="description" content="Documentation for libp2p - v0.30.0-rc.1">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="stylesheet" href="../assets/css/main.css">
|
|
<link href="https://unpkg.com/nord-highlightjs@0.1.0/dist/nord.css" rel="stylesheet" type="text/css" />
|
|
<style>
|
|
.toolbar-icon {
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
margin-left: 10px;
|
|
cursor: pointer;
|
|
}
|
|
.toolbar-icon-search {
|
|
box-sizing: border-box;
|
|
position: absolute;
|
|
overflow: hidden;
|
|
right: -40px;
|
|
width: 40px;
|
|
height: 40px;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
@media (min-width: 901px){
|
|
display: none
|
|
}
|
|
}
|
|
@media (min-width: 901px){
|
|
.toolbar-icon-menu {
|
|
display: none
|
|
}
|
|
.toolbar-icon-options {
|
|
display: none
|
|
}
|
|
}
|
|
|
|
.gg-menu {
|
|
transform: scale(var(--ggs,1))
|
|
}
|
|
.gg-menu,
|
|
.gg-menu::after,
|
|
.gg-menu::before {
|
|
box-sizing: border-box;
|
|
position: relative;
|
|
display: block;
|
|
width: 20px;
|
|
height: 2px;
|
|
border-radius: 3px;
|
|
background: currentColor
|
|
}
|
|
.gg-menu::after,
|
|
.gg-menu::before {
|
|
content: "";
|
|
position: absolute;
|
|
top: -6px
|
|
}
|
|
.gg-menu::after {
|
|
top: 6px
|
|
}
|
|
.gg-options {
|
|
box-sizing: border-box;
|
|
position: relative;
|
|
display: block;
|
|
transform: scale(var(--ggs,1));
|
|
width: 10px;
|
|
height: 2px;
|
|
box-shadow:
|
|
-3px 4px 0 0,
|
|
3px -4px 0 0
|
|
}
|
|
.gg-options::after,
|
|
.gg-options::before {
|
|
content: "";
|
|
display: block;
|
|
box-sizing: border-box;
|
|
position: absolute;
|
|
width: 8px;
|
|
height: 8px;
|
|
border: 2px solid;
|
|
border-radius: 100%
|
|
}
|
|
.gg-options::before {
|
|
top: -7px;
|
|
left: -4px
|
|
}
|
|
.gg-options::after {
|
|
bottom: -7px;
|
|
right: -4px
|
|
}
|
|
.gg-search {
|
|
box-sizing: border-box;
|
|
position: relative;
|
|
display: block;
|
|
transform: scale(var(--ggs,1));
|
|
width: 16px;
|
|
height: 16px;
|
|
border: 2px solid;
|
|
border-radius: 100%;
|
|
margin-left: -4px;
|
|
margin-top: -4px
|
|
}
|
|
.gg-search::after {
|
|
content: "";
|
|
display: block;
|
|
box-sizing: border-box;
|
|
position: absolute;
|
|
border-radius: 3px;
|
|
width: 2px;
|
|
height: 8px;
|
|
background: currentColor;
|
|
transform: rotate(-45deg);
|
|
top: 10px;
|
|
left: 12px
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<div class="tsd-page-toolbar">
|
|
<div class="container">
|
|
<div class="table-wrap">
|
|
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
|
<div class="field">
|
|
<label for="tsd-search-field" class="toolbar-icon toolbar-icon-search"><i class="gg-search"></i></label>
|
|
<input id="tsd-search-field" type="text" />
|
|
</div>
|
|
<ul class="results">
|
|
<li class="state loading">Preparing search index...</li>
|
|
<li class="state failure">The search index is not available</li>
|
|
</ul>
|
|
<a href="../index.html" class="title">libp2p - v0.30.0-rc.1</a>
|
|
</div>
|
|
<div class="table-cell" id="tsd-widgets">
|
|
<a href="#" class="toolbar-icon toolbar-icon-menu" data-toggle="menu"><i class="gg-menu"></i></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tsd-page-title">
|
|
<div class="container">
|
|
<ul class="tsd-breadcrumb">
|
|
<li>
|
|
<a href="../modules/_keychain_index_.html">keychain/index</a>
|
|
</li>
|
|
<li>
|
|
<a href="_keychain_index_.keychain.html">Keychain</a>
|
|
</li>
|
|
</ul>
|
|
<h1>Class Keychain</h1>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div class="container container-main">
|
|
<div class="row">
|
|
<div class="col-8 col-content">
|
|
<section class="tsd-panel tsd-comment">
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Manages the lifecycle of a key. Keys are encrypted at rest using PKCS #8.</p>
|
|
</div>
|
|
<p>A key in the store has two entries</p>
|
|
<ul>
|
|
<li>'/info/<em>key-name</em>', contains the KeyInfo for the key</li>
|
|
<li>'/pkcs8/<em>key-name</em>', contains the PKCS #8 for the key</li>
|
|
</ul>
|
|
</div>
|
|
</section>
|
|
<section class="tsd-panel tsd-hierarchy">
|
|
<h3>Hierarchy</h3>
|
|
<ul class="tsd-hierarchy">
|
|
<li>
|
|
<span class="target">Keychain</span>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-index-group">
|
|
<h2>Index</h2>
|
|
<section class="tsd-panel tsd-index-panel">
|
|
<div class="tsd-index-content">
|
|
<section class="tsd-index-section ">
|
|
<h3>References</h3>
|
|
<ul class="tsd-index-list">
|
|
<li class="tsd-kind-reference tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#key" class="tsd-kind-icon">Key</a></li>
|
|
<li class="tsd-kind-reference tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-kind-icon">Key<wbr>Info</a></li>
|
|
<li class="tsd-kind-reference tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#peerid" class="tsd-kind-icon">Peer<wbr>Id</a></li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-index-section ">
|
|
<h3>Constructors</h3>
|
|
<ul class="tsd-index-list">
|
|
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#constructor" class="tsd-kind-icon">constructor</a></li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-index-section ">
|
|
<h3>Properties</h3>
|
|
<ul class="tsd-index-list">
|
|
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#opts" class="tsd-kind-icon">opts</a></li>
|
|
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#store" class="tsd-kind-icon">store</a></li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-index-section ">
|
|
<h3>Accessors</h3>
|
|
<ul class="tsd-index-list">
|
|
<li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#cms" class="tsd-kind-icon">cms</a></li>
|
|
<li class="tsd-kind-get-signature tsd-parent-kind-class tsd-is-static"><a href="_keychain_index_.keychain.html#options" class="tsd-kind-icon">options</a></li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-index-section ">
|
|
<h3>Methods</h3>
|
|
<ul class="tsd-index-list">
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#_getprivatekey" class="tsd-kind-icon">_get<wbr>Private<wbr>Key</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#createkey" class="tsd-kind-icon">create<wbr>Key</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#exportkey" class="tsd-kind-icon">export<wbr>Key</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#findkeybyid" class="tsd-kind-icon">find<wbr>Key<wbr>ById</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#findkeybyname" class="tsd-kind-icon">find<wbr>Key<wbr>ByName</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#importkey" class="tsd-kind-icon">import<wbr>Key</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#importpeer" class="tsd-kind-icon">import<wbr>Peer</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#listkeys" class="tsd-kind-icon">list<wbr>Keys</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#removekey" class="tsd-kind-icon">remove<wbr>Key</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_keychain_index_.keychain.html#renamekey" class="tsd-kind-icon">rename<wbr>Key</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="_keychain_index_.keychain.html#generateoptions" class="tsd-kind-icon">generate<wbr>Options</a></li>
|
|
</ul>
|
|
</section>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
<h2>References</h2>
|
|
<section class="tsd-panel tsd-member tsd-kind-reference tsd-parent-kind-class">
|
|
<a name="key" class="tsd-anchor"></a>
|
|
<h3>Key</h3>
|
|
Re-exports <a href="../modules/_keychain_index_.html#key">Key</a>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-reference tsd-parent-kind-class">
|
|
<a name="keyinfo" class="tsd-anchor"></a>
|
|
<h3>Key<wbr>Info</h3>
|
|
Re-exports <a href="../modules/_keychain_index_.html#keyinfo">KeyInfo</a>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-reference tsd-parent-kind-class">
|
|
<a name="peerid" class="tsd-anchor"></a>
|
|
<h3>Peer<wbr>Id</h3>
|
|
Re-exports <a href="../modules/_metrics_index_.html#peerid">PeerId</a>
|
|
</section>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
<h2>Constructors</h2>
|
|
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
|
|
<a name="constructor" class="tsd-anchor"></a>
|
|
<h3>constructor</h3>
|
|
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">new <wbr>Keychain<span class="tsd-signature-symbol">(</span>store<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, options<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_keychain_index_.keychain.html" class="tsd-signature-type">Keychain</a></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Creates a new instance of a key chain.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>store: <span class="tsd-signature-type">any</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>where the key are.</p>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5>options: <span class="tsd-signature-type">object</span></h5>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <a href="_keychain_index_.keychain.html" class="tsd-signature-type">Keychain</a></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
<h2>Properties</h2>
|
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
|
|
<a name="opts" class="tsd-anchor"></a>
|
|
<h3>opts</h3>
|
|
<div class="tsd-signature tsd-kind-icon">opts<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
|
|
<a name="store" class="tsd-anchor"></a>
|
|
<h3>store</h3>
|
|
<div class="tsd-signature tsd-kind-icon">store<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
</section>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
<h2>Accessors</h2>
|
|
<section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class">
|
|
<a name="cms" class="tsd-anchor"></a>
|
|
<h3>cms</h3>
|
|
<ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> cms<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_keychain_cms_.cms.html" class="tsd-signature-type">CMS</a></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Gets an object that can encrypt/decrypt protected data
|
|
using the Cryptographic Message Syntax (CMS).</p>
|
|
</div>
|
|
<p>CMS describes an encapsulation syntax for data protection. It
|
|
is used to digitally sign, digest, authenticate, or encrypt
|
|
arbitrary message content.</p>
|
|
</div>
|
|
<h4 class="tsd-returns-title">Returns <a href="_keychain_cms_.cms.html" class="tsd-signature-type">CMS</a></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class tsd-is-static">
|
|
<a name="options" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagStatic">Static</span> options</h3>
|
|
<ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class tsd-is-static">
|
|
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> options<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Gets an object that can encrypt/decrypt protected data.
|
|
The default options for a keychain.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
<h2>Methods</h2>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="_getprivatekey" class="tsd-anchor"></a>
|
|
<h3>_get<wbr>Private<wbr>Key</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">_get<wbr>Private<wbr>Key<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Gets the private key as PEM encoded PKCS #8 string.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>name: <span class="tsd-signature-type">string</span></h5>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="createkey" class="tsd-anchor"></a>
|
|
<h3>create<wbr>Key</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">create<wbr>Key<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, size<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Create a new key.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>name: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The local key name; cannot already exist.</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5>type: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>One of the key types; 'rsa'.</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5><span class="tsd-flag ts-flagOptional">Optional</span> size: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">undefined</span></h5>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="exportkey" class="tsd-anchor"></a>
|
|
<h3>export<wbr>Key</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">export<wbr>Key<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, password<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Export an existing key as a PEM encrypted PKCS #8 string</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>name: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The local key name; must already exist.</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5>password: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The password</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="findkeybyid" class="tsd-anchor"></a>
|
|
<h3>find<wbr>Key<wbr>ById</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">find<wbr>Key<wbr>ById<span class="tsd-signature-symbol">(</span>id<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Find a key by it's id.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>id: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The universally unique key identifier.</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="findkeybyname" class="tsd-anchor"></a>
|
|
<h3>find<wbr>Key<wbr>ByName</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">find<wbr>Key<wbr>ByName<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Find a key by it's name.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>name: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The local key name.</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="importkey" class="tsd-anchor"></a>
|
|
<h3>import<wbr>Key</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">import<wbr>Key<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, pem<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, password<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Import a new key from a PEM encoded PKCS #8 string</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>name: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The local key name; must not already exist.</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5>pem: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The PEM encoded PKCS #8 string</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5>password: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The password.</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="importpeer" class="tsd-anchor"></a>
|
|
<h3>import<wbr>Peer</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">import<wbr>Peer<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, peer<span class="tsd-signature-symbol">: </span><a href="../modules/_metrics_index_.html#peerid" class="tsd-signature-type">PeerId</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Import a peer key</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>name: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The local key name; must not already exist.</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5>peer: <a href="../modules/_metrics_index_.html#peerid" class="tsd-signature-type">PeerId</a></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The PEM encoded PKCS #8 string</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="listkeys" class="tsd-anchor"></a>
|
|
<h3>list<wbr>Keys</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">list<wbr>Keys<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>List all the keys.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="removekey" class="tsd-anchor"></a>
|
|
<h3>remove<wbr>Key</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">remove<wbr>Key<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Remove an existing key.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>name: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The local key name; must already exist.</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="renamekey" class="tsd-anchor"></a>
|
|
<h3>rename<wbr>Key</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">rename<wbr>Key<span class="tsd-signature-symbol">(</span>oldName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, newName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Rename a key</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>oldName: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The old local key name; must already exist.</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5>newName: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The new local key name; must not already exist.</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="_keychain_index_.keychain.html#keyinfo" class="tsd-signature-type">KeyInfo</a><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<a name="generateoptions" class="tsd-anchor"></a>
|
|
<h3><span class="tsd-flag ts-flagStatic">Static</span> generate<wbr>Options</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<li class="tsd-signature tsd-kind-icon">generate<wbr>Options<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Generates the options for a keychain. A random salt is produced.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</section>
|
|
</div>
|
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
<nav class="tsd-navigation primary">
|
|
<ul>
|
|
<li class="current tsd-kind-module">
|
|
<a href="../modules/_keychain_index_.html">keychain/index</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
<nav class="tsd-navigation secondary menu-sticky">
|
|
<ul class="before-current">
|
|
</ul>
|
|
<ul class="current">
|
|
<li class="current tsd-kind-class tsd-parent-kind-module">
|
|
<a href="_keychain_index_.keychain.html" class="tsd-kind-icon">Keychain</a>
|
|
<ul>
|
|
<li class=" tsd-kind-reference tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#key" class="tsd-kind-icon">Key</a>
|
|
</li>
|
|
<li class=" tsd-kind-reference tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#keyinfo" class="tsd-kind-icon">Key<wbr>Info</a>
|
|
</li>
|
|
<li class=" tsd-kind-reference tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#peerid" class="tsd-kind-icon">Peer<wbr>Id</a>
|
|
</li>
|
|
<li class=" tsd-kind-constructor tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#constructor" class="tsd-kind-icon">constructor</a>
|
|
</li>
|
|
<li class=" tsd-kind-property tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#opts" class="tsd-kind-icon">opts</a>
|
|
</li>
|
|
<li class=" tsd-kind-property tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#store" class="tsd-kind-icon">store</a>
|
|
</li>
|
|
<li class=" tsd-kind-get-signature tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#cms" class="tsd-kind-icon">cms</a>
|
|
</li>
|
|
<li class=" tsd-kind-get-signature tsd-parent-kind-class tsd-is-static">
|
|
<a href="_keychain_index_.keychain.html#options" class="tsd-kind-icon">options</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#_getprivatekey" class="tsd-kind-icon">_get<wbr>Private<wbr>Key</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#createkey" class="tsd-kind-icon">create<wbr>Key</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#exportkey" class="tsd-kind-icon">export<wbr>Key</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#findkeybyid" class="tsd-kind-icon">find<wbr>Key<wbr>ById</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#findkeybyname" class="tsd-kind-icon">find<wbr>Key<wbr>ByName</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#importkey" class="tsd-kind-icon">import<wbr>Key</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#importpeer" class="tsd-kind-icon">import<wbr>Peer</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#listkeys" class="tsd-kind-icon">list<wbr>Keys</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#removekey" class="tsd-kind-icon">remove<wbr>Key</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="_keychain_index_.keychain.html#renamekey" class="tsd-kind-icon">rename<wbr>Key</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
|
|
<a href="_keychain_index_.keychain.html#generateoptions" class="tsd-kind-icon">generate<wbr>Options</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="after-current">
|
|
<li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-is-not-exported">
|
|
<a href="../modules/_keychain_index_.html#key" class="tsd-kind-icon">Key</a>
|
|
</li>
|
|
<li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-is-not-exported">
|
|
<a href="../modules/_keychain_index_.html#keyinfo" class="tsd-kind-icon">Key<wbr>Info</a>
|
|
</li>
|
|
<li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-is-not-exported">
|
|
<a href="../modules/_keychain_index_.html#peerid" class="tsd-kind-icon">Peer<wbr>Id</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<footer>
|
|
<div class="container">
|
|
<h2>Legend</h2>
|
|
<div class="tsd-legend-group">
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
|
|
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
|
|
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
|
|
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
|
|
</ul>
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-namespace"><span class="tsd-kind-icon">Namespace</span></li>
|
|
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
|
|
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
|
|
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
|
|
</ul>
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
|
|
</ul>
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
<div class="overlay"></div>
|
|
<script src="../assets/js/main.js"></script>
|
|
</body>
|
|
</html> |