2021-05-10 20:56:20 +02:00
|
|
|
<!doctype html>
|
|
|
|
<html class="no-js" lang="">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
|
|
<title>CICADA</title>
|
|
|
|
<meta name="description" content="">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
|
|
|
|
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
|
|
|
|
<link rel="stylesheet" href="../styles/style.css">
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div class="navbar navbar-default navbar-fixed-top visible-xs">
|
|
|
|
<a href="../" class="navbar-brand">CICADA</a>
|
|
|
|
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="xs-menu menu" id="mobile-menu">
|
|
|
|
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="container-fluid main">
|
|
|
|
<div class="row main">
|
|
|
|
<div class="hidden-xs menu">
|
|
|
|
<compodoc-menu mode="normal"></compodoc-menu>
|
|
|
|
</div>
|
|
|
|
<!-- START CONTENT -->
|
|
|
|
<div class="content interface">
|
|
|
|
<div class="content-data">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ol class="breadcrumb">
|
|
|
|
<li>Interfaces</li>
|
|
|
|
<li>MutableKeyStore</li>
|
|
|
|
</ol>
|
|
|
|
|
|
|
|
<ul class="nav nav-tabs" role="tablist">
|
|
|
|
<li class="active">
|
|
|
|
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a>
|
|
|
|
</li>
|
|
|
|
<li >
|
|
|
|
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<div class="tab-content">
|
|
|
|
<div class="tab-pane fade active in" id="c-info">
|
|
|
|
<p class="comment">
|
|
|
|
<h3>File</h3>
|
|
|
|
</p>
|
|
|
|
<p class="comment">
|
|
|
|
<code>src/app/_pgp/pgp-key-store.ts</code>
|
|
|
|
</p>
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<p class="comment">
|
|
|
|
<h3>Description</h3>
|
|
|
|
</p>
|
|
|
|
<p class="comment">
|
|
|
|
<p>Mutable Key store interface.</p>
|
|
|
|
|
|
|
|
</p>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<p class="comment">
|
|
|
|
<h3>Extends</h3>
|
|
|
|
</p>
|
|
|
|
<p class="comment">
|
|
|
|
<code>KeyStore</code>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<h3 id="index">Index</h3>
|
|
|
|
<table class="table table-sm table-bordered index-table">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<h6><b>Methods</b></h6>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<ul class="index-list">
|
|
|
|
<li>
|
|
|
|
<a href="#clearKeysInKeyring">clearKeysInKeyring</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#getEncryptKeys">getEncryptKeys</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#getFingerprint">getFingerprint</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#getKeyId">getKeyId</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#getKeysForId">getKeysForId</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#getPrivateKey">getPrivateKey</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#getPrivateKeyForId">getPrivateKeyForId</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#getPrivateKeyId">getPrivateKeyId</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#getPrivateKeys">getPrivateKeys</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#getPublicKeyForId">getPublicKeyForId</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#getPublicKeyForSubkeyId">getPublicKeyForSubkeyId</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#getPublicKeys">getPublicKeys</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#getPublicKeysForAddress">getPublicKeysForAddress</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#getTrustedActiveKeys">getTrustedActiveKeys</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#getTrustedKeys">getTrustedKeys</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#importKeyPair">importKeyPair</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#importPrivateKey">importPrivateKey</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#importPublicKey">importPublicKey</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#isEncryptedPrivateKey">isEncryptedPrivateKey</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#isValidKey">isValidKey</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#loadKeyring">loadKeyring</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#removeKeysForId">removeKeysForId</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#removePublicKey">removePublicKey</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#removePublicKeyForId">removePublicKeyForId</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#sign">sign</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
|
|
|
|
<h3 id="methods">
|
|
|
|
Methods
|
|
|
|
</h3>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="clearKeysInKeyring"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
clearKeysInKeyring
|
|
|
|
</b>
|
|
|
|
<a href="#clearKeysInKeyring"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>clearKeysInKeyring()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="16"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:16</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Remove all keys from the keyring. </p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getEncryptKeys"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
getEncryptKeys
|
|
|
|
</b>
|
|
|
|
<a href="#getEncryptKeys"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getEncryptKeys()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="24"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:24</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Get all the encryption keys.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<div>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Array<any></code>
|
|
|
|
|
|
|
|
</div>
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<p>An array of encryption keys.</p>
|
|
|
|
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getFingerprint"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
getFingerprint
|
|
|
|
</b>
|
|
|
|
<a href="#getFingerprint"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getFingerprint()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="29"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:29</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Get the first private key's fingerprint.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<div>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
|
|
|
|
|
|
</div>
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<p>The first private key's fingerprint.</p>
|
|
|
|
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getKeyId"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
getKeyId
|
|
|
|
</b>
|
|
|
|
<a href="#getKeyId"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getKeyId(key: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="35"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:35</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Get a key's keyId.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>key</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The key to fetch the keyId from.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
2021-05-12 12:21:18 +02:00
|
|
|
<p>The key's keyId.</p>
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getKeysForId"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
getKeysForId
|
|
|
|
</b>
|
|
|
|
<a href="#getKeysForId"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getKeysForId(keyId: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="41"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:41</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Get keys from the keyring using their keyId.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>keyId</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The keyId of the keys to be fetched from the keyring.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Array<any></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
2021-05-12 12:21:18 +02:00
|
|
|
<p>An array of the keys with that keyId.</p>
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getPrivateKey"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
getPrivateKey
|
|
|
|
</b>
|
|
|
|
<a href="#getPrivateKey"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getPrivateKey()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="46"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:46</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Get the first private key.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<div>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
|
|
|
|
</div>
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<p>The first private key.</p>
|
|
|
|
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getPrivateKeyForId"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
getPrivateKeyForId
|
|
|
|
</b>
|
|
|
|
<a href="#getPrivateKeyForId"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getPrivateKeyForId(keyId: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="52"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:52</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Get a private key from the keyring using it's keyId.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>keyId</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The keyId of the private key to be fetched from the keyring.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
2021-05-12 12:21:18 +02:00
|
|
|
<p>The private key with that keyId.</p>
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getPrivateKeyId"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
getPrivateKeyId
|
|
|
|
</b>
|
|
|
|
<a href="#getPrivateKeyId"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getPrivateKeyId()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="57"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:57</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Get the first private key's keyID.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<div>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
|
|
|
|
|
|
</div>
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<p>The first private key's keyId.</p>
|
|
|
|
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getPrivateKeys"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
getPrivateKeys
|
|
|
|
</b>
|
|
|
|
<a href="#getPrivateKeys"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getPrivateKeys()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="62"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:62</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Get all private keys.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<div>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Array<any></code>
|
|
|
|
|
|
|
|
</div>
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<p>An array of all private keys.</p>
|
|
|
|
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getPublicKeyForId"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
getPublicKeyForId
|
|
|
|
</b>
|
|
|
|
<a href="#getPublicKeyForId"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getPublicKeyForId(keyId: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="68"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:68</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Get a public key from the keyring using it's keyId.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>keyId</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The keyId of the public key to be fetched from the keyring.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
2021-05-12 12:21:18 +02:00
|
|
|
<p>The public key with that keyId.</p>
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getPublicKeyForSubkeyId"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
getPublicKeyForSubkeyId
|
|
|
|
</b>
|
|
|
|
<a href="#getPublicKeyForSubkeyId"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getPublicKeyForSubkeyId(subkeyId: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="74"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:74</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Get a public key from the keyring using it's subkeyId.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>subkeyId</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The subkeyId of the public key to be fetched from the keyring.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
2021-05-12 12:21:18 +02:00
|
|
|
<p>The public key with that subkeyId.</p>
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getPublicKeys"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
getPublicKeys
|
|
|
|
</b>
|
|
|
|
<a href="#getPublicKeys"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getPublicKeys()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="79"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:79</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Get all the public keys.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<div>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Array<any></code>
|
|
|
|
|
|
|
|
</div>
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<p>An array of public keys.</p>
|
|
|
|
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getPublicKeysForAddress"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
getPublicKeysForAddress
|
|
|
|
</b>
|
|
|
|
<a href="#getPublicKeysForAddress"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getPublicKeysForAddress(address: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="85"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:85</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Get public keys from the keyring using their address.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>address</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The address of the public keys to be fetched from the keyring.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Array<any></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
2021-05-12 12:21:18 +02:00
|
|
|
<p>An array of the public keys with that address.</p>
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getTrustedActiveKeys"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
getTrustedActiveKeys
|
|
|
|
</b>
|
|
|
|
<a href="#getTrustedActiveKeys"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getTrustedActiveKeys()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="90"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:90</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Get all the trusted active keys.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<div>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Array<any></code>
|
|
|
|
|
|
|
|
</div>
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<p>An array of trusted active keys.</p>
|
|
|
|
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="getTrustedKeys"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
getTrustedKeys
|
|
|
|
</b>
|
|
|
|
<a href="#getTrustedKeys"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>getTrustedKeys()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="95"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:95</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Get all the trusted keys.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<div>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Array<any></code>
|
|
|
|
|
|
|
|
</div>
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description">
|
|
|
|
<p>An array of trusted keys.</p>
|
|
|
|
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="importKeyPair"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
importKeyPair
|
|
|
|
</b>
|
|
|
|
<a href="#importKeyPair"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>importKeyPair(publicKey: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>, privateKey: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="103"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:103</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Add a key pair to keyring.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>publicKey</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The public key to be added to the keyring.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>privateKey</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The private key to be added to the keyring.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Promise<void></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="importPrivateKey"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
importPrivateKey
|
|
|
|
</b>
|
|
|
|
<a href="#importPrivateKey"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>importPrivateKey(privateKey: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="110"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:110</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Add private key to keyring.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>privateKey</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The private key to be added to the keyring.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Promise<void></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="importPublicKey"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
importPublicKey
|
|
|
|
</b>
|
|
|
|
<a href="#importPublicKey"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>importPublicKey(publicKey: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="117"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:117</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Add public key to keyring.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>publicKey</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The public key to be added to the keyring.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
2021-05-12 12:21:18 +02:00
|
|
|
<b>Returns : </b> <code>Promise<void></code>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="isEncryptedPrivateKey"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
isEncryptedPrivateKey
|
|
|
|
</b>
|
|
|
|
<a href="#isEncryptedPrivateKey"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>isEncryptedPrivateKey(privateKey: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="124"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:124</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Verify that a private key is encrypted.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>privateKey</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The private key to verify.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Promise<boolean></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
2021-05-12 12:21:18 +02:00
|
|
|
<p>true - If private key is encrypted.</p>
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="isValidKey"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
isValidKey
|
|
|
|
</b>
|
|
|
|
<a href="#isValidKey"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>isValidKey(key: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="131"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:131</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Test if the input is a valid key.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>key</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The input to be validated.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Promise<boolean></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
2021-05-12 12:21:18 +02:00
|
|
|
<p>true - If the input is a valid key.</p>
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="loadKeyring"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
loadKeyring
|
|
|
|
</b>
|
|
|
|
<a href="#loadKeyring"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>loadKeyring()</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="136"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:136</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Instantiate the keyring in the keystore.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="removeKeysForId"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
removeKeysForId
|
|
|
|
</b>
|
|
|
|
<a href="#removeKeysForId"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>removeKeysForId(keyId: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="142"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:142</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Remove a public key from the keyring using it's keyId.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>keyId</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The keyId of the keys to be removed from the keyring.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Array<any></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
2021-05-12 12:21:18 +02:00
|
|
|
<p>An array of the removed keys.</p>
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="removePublicKey"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
removePublicKey
|
|
|
|
</b>
|
|
|
|
<a href="#removePublicKey"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>removePublicKey(publicKey: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="148"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:148</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Remove a public key from the keyring.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>publicKey</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The public key to be removed from the keyring.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
2021-05-12 12:21:18 +02:00
|
|
|
<p>The removed public key.</p>
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="removePublicKeyForId"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
removePublicKeyForId
|
|
|
|
</b>
|
|
|
|
<a href="#removePublicKeyForId"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>removePublicKeyForId(keyId: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-13 09:13:51 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="154"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:154</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Remove a public key from the keyring using it's keyId.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>keyId</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The keyId of the public key to be removed from the keyring.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
2021-05-12 12:21:18 +02:00
|
|
|
<p>The removed public key.</p>
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="table table-sm table-bordered">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<a name="sign"></a>
|
|
|
|
<span class="name">
|
|
|
|
<b>
|
|
|
|
sign
|
|
|
|
</b>
|
|
|
|
<a href="#sign"><span class="icon ion-ios-link"></span></a>
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
|
|
|
<code>sign(plainText: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-line">Defined in <a href="" data-line="161"
|
|
|
|
class="link-to-prism">src/app/_pgp/pgp-key-store.ts:161</a></div>
|
2021-05-10 20:56:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="col-md-4">
|
2021-05-12 12:21:18 +02:00
|
|
|
<div class="io-description"><p>Sign message using private key.</p>
|
|
|
|
</div>
|
2021-05-10 20:56:20 +02:00
|
|
|
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Parameters :</b>
|
|
|
|
<table class="params">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Type</td>
|
|
|
|
<td>Optional</td>
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>Description</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>plainText</td>
|
|
|
|
<td>
|
|
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
No
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<li>The message to be signed.</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</td>
|
2021-05-10 20:56:20 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
|
|
|
<b>Returns : </b> <code>Promise<any></code>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="io-description">
|
2021-05-12 12:21:18 +02:00
|
|
|
<p>The generated signature.</p>
|
|
|
|
|
2021-05-10 20:56:20 +02:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="tab-pane fade tab-source-code" id="c-source">
|
|
|
|
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { KeyStore } from 'cic-client-meta';
|
|
|
|
// TODO should we put this on the mutable key store object
|
|
|
|
import * as openpgp from 'openpgp';
|
2021-05-12 12:21:18 +02:00
|
|
|
|
|
|
|
/** An openpgp Keyring instance. */
|
2021-05-10 20:56:20 +02:00
|
|
|
const keyring = new openpgp.Keyring();
|
|
|
|
|
2021-05-12 08:16:38 +02:00
|
|
|
/**
|
2021-05-12 12:21:18 +02:00
|
|
|
* Mutable Key store interface.
|
|
|
|
*
|
|
|
|
* @extends KeyStore
|
2021-05-12 08:16:38 +02:00
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
interface MutableKeyStore extends KeyStore {
|
2021-05-13 09:13:51 +02:00
|
|
|
/** Remove all keys from the keyring. */
|
|
|
|
clearKeysInKeyring(): void;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Get all the encryption keys.
|
|
|
|
* @returns An array of encryption keys.
|
|
|
|
* @remarks
|
|
|
|
* Current implementation doesn't include encryption keys.
|
|
|
|
* This is included to appease the implemented Keystore interface.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
getEncryptKeys(): Array<any>;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Get the first private key's fingerprint.
|
|
|
|
* @returns The first private key's fingerprint.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
getFingerprint(): string;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Get a key's keyId.
|
|
|
|
* @param key - The key to fetch the keyId from.
|
|
|
|
* @returns The key's keyId.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
getKeyId(key: any): string;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Get keys from the keyring using their keyId.
|
|
|
|
* @param keyId - The keyId of the keys to be fetched from the keyring.
|
|
|
|
* @returns An array of the keys with that keyId.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
getKeysForId(keyId: string): Array<any>;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Get the first private key.
|
|
|
|
* @returns The first private key.
|
2021-05-12 12:21:18 +02:00
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
getPrivateKey(): any;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Get a private key from the keyring using it's keyId.
|
|
|
|
* @param keyId - The keyId of the private key to be fetched from the keyring.
|
|
|
|
* @returns The private key with that keyId.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
getPrivateKeyForId(keyId: string): any;
|
2021-05-13 09:13:51 +02:00
|
|
|
/**
|
|
|
|
* Get the first private key's keyID.
|
|
|
|
* @returns The first private key's keyId.
|
|
|
|
*/
|
|
|
|
getPrivateKeyId(): string;
|
|
|
|
/**
|
|
|
|
* Get all private keys.
|
|
|
|
* @returns An array of all private keys.
|
|
|
|
*/
|
|
|
|
getPrivateKeys(): Array<any>;
|
|
|
|
/**
|
|
|
|
* Get a public key from the keyring using it's keyId.
|
|
|
|
* @param keyId - The keyId of the public key to be fetched from the keyring.
|
|
|
|
* @returns The public key with that keyId.
|
|
|
|
*/
|
|
|
|
getPublicKeyForId(keyId: string): any;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Get a public key from the keyring using it's subkeyId.
|
|
|
|
* @param subkeyId - The subkeyId of the public key to be fetched from the keyring.
|
|
|
|
* @returns The public key with that subkeyId.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
getPublicKeyForSubkeyId(subkeyId: string): any;
|
2021-05-13 09:13:51 +02:00
|
|
|
/**
|
|
|
|
* Get all the public keys.
|
|
|
|
* @returns An array of public keys.
|
|
|
|
*/
|
|
|
|
getPublicKeys(): Array<any>;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Get public keys from the keyring using their address.
|
|
|
|
* @param address - The address of the public keys to be fetched from the keyring.
|
|
|
|
* @returns An array of the public keys with that address.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
getPublicKeysForAddress(address: string): Array<any>;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Get all the trusted active keys.
|
|
|
|
* @returns An array of trusted active keys.
|
2021-05-12 12:21:18 +02:00
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
getTrustedActiveKeys(): Array<any>;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Get all the trusted keys.
|
|
|
|
* @returns An array of trusted keys.
|
2021-05-12 12:21:18 +02:00
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
getTrustedKeys(): Array<any>;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Add a key pair to keyring.
|
|
|
|
* @async
|
|
|
|
* @param publicKey - The public key to be added to the keyring.
|
|
|
|
* @param privateKey - The private key to be added to the keyring.
|
|
|
|
* @throws Error
|
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
importKeyPair(publicKey: any, privateKey: any): Promise<void>;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Add private key to keyring.
|
2021-05-12 12:21:18 +02:00
|
|
|
* @async
|
2021-05-13 09:13:51 +02:00
|
|
|
* @param privateKey - The private key to be added to the keyring.
|
2021-05-12 12:21:18 +02:00
|
|
|
* @throws Error
|
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
importPrivateKey(privateKey: any): Promise<void>;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Add public key to keyring.
|
2021-05-12 12:21:18 +02:00
|
|
|
* @async
|
2021-05-13 09:13:51 +02:00
|
|
|
* @param publicKey - The public key to be added to the keyring.
|
2021-05-12 12:21:18 +02:00
|
|
|
* @throws Error
|
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
importPublicKey(publicKey: any): Promise<void>;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Verify that a private key is encrypted.
|
|
|
|
* @async
|
|
|
|
* @param privateKey - The private key to verify.
|
|
|
|
* @returns true - If private key is encrypted.
|
2021-05-12 12:21:18 +02:00
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
isEncryptedPrivateKey(privateKey: any): Promise<boolean>;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Test if the input is a valid key.
|
|
|
|
* @async
|
|
|
|
* @param key - The input to be validated.
|
|
|
|
* @returns true - If the input is a valid key.
|
2021-05-12 12:21:18 +02:00
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
isValidKey(key: any): Promise<boolean>;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Instantiate the keyring in the keystore.
|
|
|
|
* @async
|
2021-05-12 12:21:18 +02:00
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
loadKeyring(): void;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Remove a public key from the keyring using it's keyId.
|
|
|
|
* @param keyId - The keyId of the keys to be removed from the keyring.
|
|
|
|
* @returns An array of the removed keys.
|
2021-05-12 12:21:18 +02:00
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
removeKeysForId(keyId: string): Array<any>;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Remove a public key from the keyring.
|
|
|
|
* @param publicKey - The public key to be removed from the keyring.
|
|
|
|
* @returns The removed public key.
|
2021-05-12 12:21:18 +02:00
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
removePublicKey(publicKey: any): any;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Remove a public key from the keyring using it's keyId.
|
|
|
|
* @param keyId - The keyId of the public key to be removed from the keyring.
|
|
|
|
* @returns The removed public key.
|
2021-05-12 12:21:18 +02:00
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
removePublicKeyForId(keyId: string): any;
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Sign message using private key.
|
2021-05-12 12:21:18 +02:00
|
|
|
* @async
|
2021-05-13 09:13:51 +02:00
|
|
|
* @param plainText - The message to be signed.
|
|
|
|
* @returns The generated signature.
|
2021-05-12 12:21:18 +02:00
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
sign(plainText: string): Promise<any>;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Provides a keyring for pgp keys. */
|
|
|
|
class MutablePgpKeyStore implements MutableKeyStore {
|
|
|
|
/** Remove all keys from the keyring. */
|
|
|
|
clearKeysInKeyring(): void {
|
|
|
|
keyring.clear();
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Get all the encryption keys.
|
|
|
|
* @returns An array of encryption keys.
|
|
|
|
* @remarks
|
|
|
|
* Current implementation doesn't include encryption keys.
|
|
|
|
* This is included to appease the implemented Keystore interface.
|
2021-05-12 12:21:18 +02:00
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
getEncryptKeys(): Array<any> {
|
|
|
|
return [];
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Get the first private key's fingerprint.
|
|
|
|
* @returns The first private key's fingerprint.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
getFingerprint(): string {
|
|
|
|
// TODO Handle multiple keys
|
2021-05-11 19:51:48 +02:00
|
|
|
return (
|
|
|
|
keyring.privateKeys &&
|
|
|
|
keyring.privateKeys.keys[0] &&
|
|
|
|
keyring.privateKeys.keys[0].keyPacket &&
|
|
|
|
keyring.privateKeys.keys[0].keyPacket.fingerprint
|
|
|
|
);
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Get a key's keyId.
|
|
|
|
* @param key - The key to fetch the keyId from.
|
|
|
|
* @returns The key's keyId.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
getKeyId(key: any): string {
|
|
|
|
return key.getKeyId().toHex();
|
|
|
|
}
|
|
|
|
|
2021-05-13 09:13:51 +02:00
|
|
|
/**
|
|
|
|
* Get keys from the keyring using their keyId.
|
|
|
|
* @param keyId - The keyId of the keys to be fetched from the keyring.
|
|
|
|
* @returns An array of the keys with that keyId.
|
|
|
|
*/
|
|
|
|
getKeysForId(keyId: string): Array<any> {
|
|
|
|
return keyring.getKeysForId(keyId);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the first private key.
|
|
|
|
* @returns The first private key.
|
|
|
|
*/
|
|
|
|
getPrivateKey(): any {
|
|
|
|
return keyring.privateKeys && keyring.privateKeys.keys[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a private key from the keyring using it's keyId.
|
|
|
|
* @param keyId - The keyId of the private key to be fetched from the keyring.
|
|
|
|
* @returns The private key with that keyId.
|
|
|
|
*/
|
|
|
|
getPrivateKeyForId(keyId): any {
|
|
|
|
return keyring.privateKeys && keyring.privateKeys.getForId(keyId);
|
|
|
|
}
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Get the first private key's keyID.
|
|
|
|
* @returns The first private key's keyId.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
getPrivateKeyId(): string {
|
|
|
|
// TODO is there a library that comes with angular for doing this?
|
2021-05-11 19:51:48 +02:00
|
|
|
return (
|
|
|
|
keyring.privateKeys &&
|
|
|
|
keyring.privateKeys.keys[0] &&
|
|
|
|
keyring.privateKeys.keys[0].getKeyId().toHex()
|
|
|
|
);
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Get all private keys.
|
|
|
|
* @returns An array of all private keys.
|
2021-05-12 12:21:18 +02:00
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
getPrivateKeys(): Array<any> {
|
|
|
|
return keyring.privateKeys && keyring.privateKeys.keys;
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Get a public key from the keyring using it's keyId.
|
|
|
|
* @param keyId - The keyId of the public key to be fetched from the keyring.
|
|
|
|
* @returns The public key with that keyId.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
getPublicKeyForId(keyId): any {
|
2021-05-12 12:21:18 +02:00
|
|
|
return keyring.publicKeys && keyring.publicKeys.getForId(keyId);
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Get a public key from the keyring using it's subkeyId.
|
|
|
|
* @param subkeyId - The subkeyId of the public key to be fetched from the keyring.
|
|
|
|
* @returns The public key with that subkeyId.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
getPublicKeyForSubkeyId(subkeyId): any {
|
2021-05-12 12:21:18 +02:00
|
|
|
return keyring.publicKeys && keyring.publicKeys.getForId(subkeyId, true);
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-05-13 09:13:51 +02:00
|
|
|
/**
|
|
|
|
* Get all the public keys.
|
|
|
|
* @returns An array of public keys.
|
|
|
|
*/
|
|
|
|
getPublicKeys(): Array<any> {
|
|
|
|
return keyring.publicKeys && keyring.publicKeys.keys;
|
|
|
|
}
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Get public keys from the keyring using their address.
|
|
|
|
* @param address - The address of the public keys to be fetched from the keyring.
|
|
|
|
* @returns An array of the public keys with that address.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
getPublicKeysForAddress(address): Array<any> {
|
2021-05-12 12:21:18 +02:00
|
|
|
return keyring.publicKeys && keyring.publicKeys.getForAddress(address);
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
2021-05-13 09:13:51 +02:00
|
|
|
* Get all the trusted active keys.
|
|
|
|
* @returns An array of trusted active keys.
|
2021-05-12 12:21:18 +02:00
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
getTrustedActiveKeys(): Array<any> {
|
|
|
|
return keyring.publicKeys && keyring.publicKeys.keys;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all the trusted keys.
|
|
|
|
* @returns An array of trusted keys.
|
|
|
|
*/
|
|
|
|
getTrustedKeys(): Array<any> {
|
|
|
|
return keyring.publicKeys && keyring.publicKeys.keys;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a key pair to keyring.
|
|
|
|
* @async
|
|
|
|
* @param publicKey - The public key to be added to the keyring.
|
|
|
|
* @param privateKey - The private key to be added to the keyring.
|
|
|
|
* @throws Error
|
|
|
|
*/
|
|
|
|
async importKeyPair(publicKey: any, privateKey: any): Promise<void> {
|
|
|
|
try {
|
|
|
|
await keyring.publicKeys.importKey(publicKey);
|
|
|
|
await keyring.privateKeys.importKey(privateKey);
|
|
|
|
} catch (error) {
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add private key to keyring.
|
|
|
|
* @async
|
|
|
|
* @param privateKey - The private key to be added to the keyring.
|
|
|
|
* @throws Error
|
|
|
|
*/
|
|
|
|
async importPrivateKey(privateKey: any): Promise<void> {
|
|
|
|
try {
|
|
|
|
await keyring.privateKeys.importKey(privateKey);
|
|
|
|
} catch (error) {
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add public key to keyring.
|
|
|
|
* @async
|
|
|
|
* @param publicKey - The public key to be added to the keyring.
|
|
|
|
* @throws Error
|
|
|
|
*/
|
|
|
|
async importPublicKey(publicKey: any): Promise<void> {
|
|
|
|
try {
|
|
|
|
await keyring.publicKeys.importKey(publicKey);
|
|
|
|
} catch (error) {
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Verify that a private key is encrypted.
|
|
|
|
* @async
|
|
|
|
* @param privateKey - The private key to verify.
|
|
|
|
* @returns true - If private key is encrypted.
|
|
|
|
*/
|
|
|
|
async isEncryptedPrivateKey(privateKey: any): Promise<boolean> {
|
|
|
|
const imported = await openpgp.key.readArmored(privateKey);
|
|
|
|
for (const key of imported.keys) {
|
|
|
|
if (key.isDecrypted()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test if the input is a valid key.
|
|
|
|
* @async
|
|
|
|
* @param key - The input to be validated.
|
|
|
|
* @returns true - If the input is a valid key.
|
|
|
|
*/
|
|
|
|
async isValidKey(key): Promise<boolean> {
|
|
|
|
// There is supposed to be an openpgp.readKey() method but I can't find it?
|
|
|
|
const testKey = await openpgp.key.readArmored(key);
|
|
|
|
return !testKey.err;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Instantiate the keyring in the keystore.
|
|
|
|
* @async
|
|
|
|
*/
|
|
|
|
async loadKeyring(): Promise<void> {
|
|
|
|
await keyring.load();
|
|
|
|
await keyring.store();
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Remove a public key from the keyring using it's keyId.
|
2021-05-13 09:13:51 +02:00
|
|
|
* @param keyId - The keyId of the keys to be removed from the keyring.
|
|
|
|
* @returns An array of the removed keys.
|
2021-05-12 12:21:18 +02:00
|
|
|
*/
|
2021-05-13 09:13:51 +02:00
|
|
|
removeKeysForId(keyId): Array<any> {
|
|
|
|
return keyring.removeKeysForId(keyId);
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Remove a public key from the keyring.
|
|
|
|
* @param publicKey - The public key to be removed from the keyring.
|
|
|
|
* @returns The removed public key.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
removePublicKey(publicKey: any): any {
|
2021-05-11 19:51:48 +02:00
|
|
|
const keyId = publicKey.getKeyId().toHex();
|
2021-05-12 12:21:18 +02:00
|
|
|
return keyring.publicKeys && keyring.publicKeys.removeForId(keyId);
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-05-13 09:13:51 +02:00
|
|
|
/**
|
|
|
|
* Remove a public key from the keyring using it's keyId.
|
|
|
|
* @param keyId - The keyId of the public key to be removed from the keyring.
|
|
|
|
* @returns The removed public key.
|
|
|
|
*/
|
|
|
|
removePublicKeyForId(keyId): any {
|
|
|
|
return keyring.publicKeys && keyring.publicKeys.removeForId(keyId);
|
2021-05-10 20:56:20 +02:00
|
|
|
}
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
/**
|
|
|
|
* Sign message using private key.
|
|
|
|
* @async
|
|
|
|
* @param plainText - The message to be signed.
|
|
|
|
* @returns The generated signature.
|
|
|
|
*/
|
2021-05-10 20:56:20 +02:00
|
|
|
async sign(plainText): Promise<any> {
|
|
|
|
const privateKey = this.getPrivateKey();
|
|
|
|
if (!privateKey.isDecrypted()) {
|
|
|
|
const password = window.prompt('password');
|
|
|
|
await privateKey.decrypt(password);
|
|
|
|
}
|
|
|
|
const opts = {
|
|
|
|
message: openpgp.message.fromText(plainText),
|
|
|
|
privateKeys: [privateKey],
|
|
|
|
detached: true,
|
|
|
|
};
|
|
|
|
const signatureObject = await openpgp.sign(opts);
|
|
|
|
return signatureObject.signature;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-12 12:21:18 +02:00
|
|
|
/** @exports */
|
2021-05-13 09:13:51 +02:00
|
|
|
export { MutableKeyStore, MutablePgpKeyStore };
|
2021-05-10 20:56:20 +02:00
|
|
|
</code></pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div class="search-results">
|
|
|
|
<div class="has-results">
|
|
|
|
<h1 class="search-results-title"><span class='search-results-count'></span> result-matching "<span class='search-query'></span>"</h1>
|
|
|
|
<ul class="search-results-list"></ul>
|
|
|
|
</div>
|
|
|
|
<div class="no-results">
|
|
|
|
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- END CONTENT -->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
|
|
|
|
var COMPODOC_CURRENT_PAGE_CONTEXT = 'interface';
|
|
|
|
var COMPODOC_CURRENT_PAGE_URL = 'MutableKeyStore.html';
|
|
|
|
var MAX_SEARCH_RESULTS = 15;
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script src="../js/libs/custom-elements.min.js"></script>
|
|
|
|
<script src="../js/libs/lit-html.js"></script>
|
|
|
|
<!-- Required to polyfill modern browsers as code is ES5 for IE... -->
|
|
|
|
<script src="../js/libs/custom-elements-es5-adapter.js" charset="utf-8" defer></script>
|
|
|
|
<script src="../js/menu-wc.js" defer></script>
|
|
|
|
|
|
|
|
<script src="../js/libs/bootstrap-native.js"></script>
|
|
|
|
|
|
|
|
<script src="../js/libs/es6-shim.min.js"></script>
|
|
|
|
<script src="../js/libs/EventDispatcher.js"></script>
|
|
|
|
<script src="../js/libs/promise.min.js"></script>
|
|
|
|
<script src="../js/libs/zepto.min.js"></script>
|
|
|
|
|
|
|
|
<script src="../js/compodoc.js"></script>
|
|
|
|
|
|
|
|
<script src="../js/tabs.js"></script>
|
|
|
|
<script src="../js/menu.js"></script>
|
|
|
|
<script src="../js/libs/clipboard.min.js"></script>
|
|
|
|
<script src="../js/libs/prism.js"></script>
|
|
|
|
<script src="../js/sourceCode.js"></script>
|
|
|
|
<script src="../js/search/search.js"></script>
|
|
|
|
<script src="../js/search/lunr.min.js"></script>
|
|
|
|
<script src="../js/search/search-lunr.js"></script>
|
|
|
|
<script src="../js/search/search_index.js"></script>
|
|
|
|
<script src="../js/lazy-load-graphs.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|