openpgpjs/docs/module-key_Subkey-Subkey.html
2023-10-25 12:55:43 +02:00

3152 lines
44 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Subkey</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Subkey</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>
<span class="ancestors"><a href="module-key_Subkey.html">key/Subkey</a>~</span>Subkey<span class="signature">(subkeyPacket, mainKey)</span><span class="type-signature"></span></h2>
<div class="class-description"><p>Class that represents a subkey packet and the relevant signatures.</p></div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="Subkey"><span class="type-signature"></span>new Subkey<span class="signature">(subkeyPacket, mainKey)</span><span class="type-signature"></span></h4>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>subkeyPacket</code></td>
<td class="type">
<span class="param-type"><a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a></span>
|
<span class="param-type"><a href="PublicSubkeyPacket.html">PublicSubkeyPacket</a></span>
</td>
<td class="description last"><p>subkey packet to hold in the Subkey</p></td>
</tr>
<tr>
<td class="name"><code>mainKey</code></td>
<td class="type">
<span class="param-type"><a href="Key.html">Key</a></span>
</td>
<td class="description last"><p>reference to main Key object, containing the primary key packet corresponding to the subkey</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js">key/subkey.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js#L19">line 19</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="clone"><span class="type-signature"></span>clone<span class="signature">()</span><span class="type-signature"> &rarr; {Subkey}</span></h4>
<div class="description">
<p>Shallow clone</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js">key/subkey.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js#L47">line 47</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Subkey</span>
</dd>
</dl>
<h4 class="name" id="getAlgorithmInfo"><span class="type-signature"></span>getAlgorithmInfo<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
<p>Returns algorithm information</p>
</div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="PublicKeyPacket.html#getAlgorithmInfo">PublicKeyPacket#getAlgorithmInfo</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js#L266">line 266</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>An object of the form {algorithm: String, bits:int, curve:String}.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="getAlgorithmInfo"><span class="type-signature"></span>getAlgorithmInfo<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
<p>Returns algorithm information</p>
</div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="PublicKeyPacket.html#getAlgorithmInfo">PublicKeyPacket#getAlgorithmInfo</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js#L266">line 266</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>An object of the form {algorithm: String, bits:int, curve:String}.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="getCreationTime"><span class="type-signature"></span>getCreationTime<span class="signature">()</span><span class="type-signature"> &rarr; {Date}</span></h4>
<div class="description">
<p>Returns the creation time of the key</p>
</div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="PublicKeyPacket.html#getCreationTime">PublicKeyPacket#getCreationTime</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js#L194">line 194</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Date</span>
</dd>
</dl>
<h4 class="name" id="getCreationTime"><span class="type-signature"></span>getCreationTime<span class="signature">()</span><span class="type-signature"> &rarr; {Date}</span></h4>
<div class="description">
<p>Returns the creation time of the key</p>
</div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="PublicKeyPacket.html#getCreationTime">PublicKeyPacket#getCreationTime</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js#L194">line 194</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Date</span>
</dd>
</dl>
<h4 class="name" id="getExpirationTime"><span class="type-signature">(async) </span>getExpirationTime<span class="signature">(date, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;(Date|Infinity|null)>}</span></h4>
<div class="description">
<p>Returns the expiration time of the subkey or Infinity if key does not expire.
Returns null if the subkey is invalid.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>date</code></td>
<td class="type">
<span class="param-type">Date</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Use the given date instead of the current time</p></td>
</tr>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js">key/subkey.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js#L109">line 109</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;(Date|Infinity|null)></span>
</dd>
</dl>
<h4 class="name" id="getFingerprint"><span class="type-signature"></span>getFingerprint<span class="signature">()</span><span class="type-signature"> &rarr; {String}</span></h4>
<div class="description">
<p>Calculates and returns the fingerprint of the key, as a string</p>
</div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="PublicKeyPacket.html#getFingerprint">PublicKeyPacket#getFingerprint</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js#L250">line 250</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>A string containing the fingerprint in lowercase hex</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
<h4 class="name" id="getFingerprint"><span class="type-signature"></span>getFingerprint<span class="signature">()</span><span class="type-signature"> &rarr; {String}</span></h4>
<div class="description">
<p>Calculates and returns the fingerprint of the key, as a string</p>
</div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="PublicKeyPacket.html#getFingerprint">PublicKeyPacket#getFingerprint</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js#L250">line 250</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>A string containing the fingerprint in lowercase hex</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
<h4 class="name" id="getKeyID"><span class="type-signature"></span>getKeyID<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="module-type_keyid-KeyID.html">module:type/keyid~KeyID</a>}</span></h4>
<div class="description">
<p>Return the key ID of the key</p>
</div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="PublicKeyPacket.html#getKeyID">PublicKeyPacket#getKeyID</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js#L202">line 202</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The 8-byte key ID</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="module-type_keyid-KeyID.html">module:type/keyid~KeyID</a></span>
</dd>
</dl>
<h4 class="name" id="getKeyID"><span class="type-signature"></span>getKeyID<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="module-type_keyid-KeyID.html">module:type/keyid~KeyID</a>}</span></h4>
<div class="description">
<p>Return the key ID of the key</p>
</div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="PublicKeyPacket.html#getKeyID">PublicKeyPacket#getKeyID</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js#L202">line 202</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The 8-byte key ID</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="module-type_keyid-KeyID.html">module:type/keyid~KeyID</a></span>
</dd>
</dl>
<h4 class="name" id="hasSameFingerprintAs"><span class="type-signature"></span>hasSameFingerprintAs<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
<div class="description">
<p>Calculates whether two keys have the same fingerprint without actually calculating the fingerprint</p>
</div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="PublicKeyPacket.html#hasSameFingerprintAs">PublicKeyPacket#hasSameFingerprintAs</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js#L258">line 258</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Whether the two keys have the same version and public key data.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id="hasSameFingerprintAs"><span class="type-signature"></span>hasSameFingerprintAs<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
<div class="description">
<p>Calculates whether two keys have the same fingerprint without actually calculating the fingerprint</p>
</div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="PublicKeyPacket.html#hasSameFingerprintAs">PublicKeyPacket#hasSameFingerprintAs</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js#L258">line 258</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Whether the two keys have the same version and public key data.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id="isDecrypted"><span class="type-signature"></span>isDecrypted<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean|null}</span></h4>
<div class="description">
<p>Check whether secret-key data is available in decrypted form. Returns null for public keys.</p>
</div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="PublicKeyPacket.html#isDecrypted">PublicKeyPacket#isDecrypted</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js#L186">line 186</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
|
<span class="param-type">null</span>
</dd>
</dl>
<h4 class="name" id="isDecrypted"><span class="type-signature"></span>isDecrypted<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean|null}</span></h4>
<div class="description">
<p>Check whether secret-key data is available in decrypted form. Returns null for public keys.</p>
</div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="PublicKeyPacket.html#isDecrypted">PublicKeyPacket#isDecrypted</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/packet/public_key.js#L186">line 186</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
|
<span class="param-type">null</span>
</dd>
</dl>
<h4 class="name" id="isRevoked"><span class="type-signature">(async) </span>isRevoked<span class="signature">(signature, key,, date<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Boolean>}</span></h4>
<div class="description">
<p>Checks if a binding signature of a subkey is revoked</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>signature</code></td>
<td class="type">
<span class="param-type"><a href="SignaturePacket.html">SignaturePacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The binding signature to verify</p></td>
</tr>
<tr>
<td class="name"><code>key,</code></td>
<td class="type">
<span class="param-type"><a href="PublicSubkeyPacket.html">PublicSubkeyPacket</a></span>
|
<span class="param-type"><a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a></span>
|
<span class="param-type"><a href="PublicKeyPacket.html">PublicKeyPacket</a></span>
|
<span class="param-type"><a href="SecretKeyPacket.html">SecretKeyPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>optional The key to verify the signature</p></td>
</tr>
<tr>
<td class="name"><code>date</code></td>
<td class="type">
<span class="param-type">Date</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Use the given date for verification instead of the current time</p></td>
</tr>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js">key/subkey.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js#L66">line 66</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>True if the binding signature is revoked.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;Boolean></span>
</dd>
</dl>
<h4 class="name" id="revoke"><span class="type-signature">(async) </span>revoke<span class="signature">(primaryKey, reasonForRevocation, date, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Subkey>}</span></h4>
<div class="description">
<p>Revokes the subkey</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>primaryKey</code></td>
<td class="type">
<span class="param-type"><a href="SecretKeyPacket.html">SecretKeyPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>decrypted private primary key for revocation</p></td>
</tr>
<tr>
<td class="name"><code>reasonForRevocation</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>optional, object indicating the reason for revocation</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>flag</code></td>
<td class="type">
<span class="param-type"><a href="module-enums.html#.reasonForRevocation">module:enums.reasonForRevocation</a></span>
</td>
<td class="description last"><p>optional, flag indicating the reason for revocation</p></td>
</tr>
<tr>
<td class="name"><code>string</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>optional, string explaining the reason for revocation</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>date</code></td>
<td class="type">
<span class="param-type">Date</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>optional, override the creationtime of the revocation signature</p></td>
</tr>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js">key/subkey.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js#L177">line 177</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>New subkey with revocation signature.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;Subkey></span>
</dd>
</dl>
<h4 class="name" id="toPacketList"><span class="type-signature"></span>toPacketList<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="PacketList.html">PacketList</a>}</span></h4>
<div class="description">
<p>Transforms structured subkey data to packetlist</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js">key/subkey.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js#L35">line 35</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="PacketList.html">PacketList</a></span>
</dd>
</dl>
<h4 class="name" id="update"><span class="type-signature">(async) </span>update<span class="signature">(subkey, date<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Update subkey with new components from specified subkey</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>subkey</code></td>
<td class="type">
<span class="param-type">Subkey</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Source subkey to merge</p></td>
</tr>
<tr>
<td class="name"><code>date</code></td>
<td class="type">
<span class="param-type">Date</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Date to verify validity of signatures</p></td>
</tr>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js">key/subkey.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js#L131">line 131</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<dl>
<dt>
<div class="param-desc">
<p>if update failed</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Error</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
<h4 class="name" id="verify"><span class="type-signature">(async) </span>verify<span class="signature">(date, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="SignaturePacket.html">SignaturePacket</a>>}</span></h4>
<div class="description">
<p>Verify subkey. Checks for revocation signatures, expiration time
and valid binding signature.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>date</code></td>
<td class="type">
<span class="param-type">Date</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Use the given date instead of the current time</p></td>
</tr>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js">key/subkey.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.0.0-alpha.0/src/key/subkey.js#L85">line 85</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<dl>
<dt>
<div class="param-desc">
<p>if the subkey is invalid.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Error</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;<a href="SignaturePacket.html">SignaturePacket</a>></span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Functions</h3><ul><li><a href="global.html#aes">aes</a></li><li><a href="global.html#armor">armor</a></li><li><a href="global.html#createCleartextMessage">createCleartextMessage</a></li><li><a href="global.html#createKey">createKey</a></li><li><a href="global.html#createMessage">createMessage</a></li><li><a href="global.html#decrypt">decrypt</a></li><li><a href="global.html#decryptKey">decryptKey</a></li><li><a href="global.html#decryptSessionKeys">decryptSessionKeys</a></li><li><a href="global.html#detectBigInt">detectBigInt</a></li><li><a href="global.html#encrypt">encrypt</a></li><li><a href="global.html#encryptKey">encryptKey</a></li><li><a href="global.html#encryptSessionKey">encryptSessionKey</a></li><li><a href="global.html#formatObject">formatObject</a></li><li><a href="global.html#generateKey">generateKey</a></li><li><a href="global.html#generateSessionKey">generateSessionKey</a></li><li><a href="global.html#newPacketFromTag">newPacketFromTag</a></li><li><a href="global.html#newS2KFromConfig">newS2KFromConfig</a></li><li><a href="global.html#newS2KFromType">newS2KFromType</a></li><li><a href="global.html#produceEncryptionKey">produceEncryptionKey</a></li><li><a href="global.html#readCleartextMessage">readCleartextMessage</a></li><li><a href="global.html#readKey">readKey</a></li><li><a href="global.html#readKeys">readKeys</a></li><li><a href="global.html#readMessage">readMessage</a></li><li><a href="global.html#readPrivateKey">readPrivateKey</a></li><li><a href="global.html#readPrivateKeys">readPrivateKeys</a></li><li><a href="global.html#readSignature">readSignature</a></li><li><a href="global.html#reformatKey">reformatKey</a></li><li><a href="global.html#revokeKey">revokeKey</a></li><li><a href="global.html#runAEAD">runAEAD</a></li><li><a href="global.html#sign">sign</a></li><li><a href="global.html#unarmor">unarmor</a></li><li><a href="global.html#verify">verify</a></li><li><a href="global.html#wrapKeyObject">wrapKeyObject</a></li></ul><h3>Modules</h3><ul><li><a href="module-config.html">config</a></li><li><a href="module-crypto.html">crypto</a></li><li><a href="module-crypto_aes_kw.html">crypto/aes_kw</a></li><li><a href="module-crypto_cipher.html">crypto/cipher</a></li><li><a href="module-crypto_cmac.html">crypto/cmac</a></li><li><a href="module-crypto_crypto.html">crypto/crypto</a></li><li><a href="module-crypto_hash.html">crypto/hash</a></li><li><a href="module-crypto_hkdf.html">crypto/hkdf</a></li><li><a href="module-crypto_mode.html">crypto/mode</a></li><li><a href="module-crypto_mode_cfb.html">crypto/mode/cfb</a></li><li><a href="module-crypto_mode_eax.html">crypto/mode/eax</a></li><li><a href="module-crypto_mode_gcm.html">crypto/mode/gcm</a></li><li><a href="module-crypto_mode_ocb.html">crypto/mode/ocb</a></li><li><a href="module-crypto_pkcs1.html">crypto/pkcs1</a></li><li><a href="module-crypto_public_key.html">crypto/public_key</a></li><li><a href="module-crypto_public_key_dsa.html">crypto/public_key/dsa</a></li><li><a href="module-crypto_public_key_elgamal.html">crypto/public_key/elgamal</a></li><li><a href="module-crypto_public_key_elliptic.html">crypto/public_key/elliptic</a></li><li><a href="module-crypto_public_key_elliptic_curve.html">crypto/public_key/elliptic/curve</a></li><li><a href="module-crypto_public_key_elliptic_ecdh.html">crypto/public_key/elliptic/ecdh</a></li><li><a href="module-crypto_public_key_elliptic_ecdsa.html">crypto/public_key/elliptic/ecdsa</a></li><li><a href="module-crypto_public_key_elliptic_eddsa.html">crypto/public_key/elliptic/eddsa</a></li><li><a href="module-crypto_public_key_elliptic_eddsa_legacy.html">crypto/public_key/elliptic/eddsa_legacy</a></li><li><a href="module-crypto_public_key_prime.html">crypto/public_key/prime</a></li><li><a href="module-crypto_public_key_rsa.html">crypto/public_key/rsa</a></li><li><a href="module-crypto_random.html">crypto/random</a></li><li><a href="module-crypto_signature.html">crypto/signature</a></li><li><a href="module-encoding_base64.html">encoding/base64</a></li><li><a href="module-enums.html">enums</a></li><li><a href="module-key_helper.html">key/helper</a></li><li><a href="module-key_Subkey.html">key/Subkey</a></li><li><a href="module-key_User.html">key/User</a></li><li><a href="module-packet_packet.html">packet/packet</a></li><li><a href="module-type_ecdh_symkey.html">type/ecdh_symkey</a></li><li><a href="module-type_keyid.html">type/keyid</a></li><li><a href="module-type_oid.html">type/oid</a></li><li><a href="module-type_s2k.html">type/s2k</a></li><li><a href="module-type_x25519x448_symkey.html">type/x25519x448_symkey</a></li><li><a href="module-util.html">util</a></li></ul><h3>Classes</h3><ul><li><a href="AEADEncryptedDataPacket.html">AEADEncryptedDataPacket</a></li><li><a href="Argon2S2K.html">Argon2S2K</a></li><li><a href="CleartextMessage.html">CleartextMessage</a></li><li><a href="CompressedDataPacket.html">CompressedDataPacket</a></li><li><a href="Key.html">Key</a></li><li><a href="LiteralDataPacket.html">LiteralDataPacket</a></li><li><a href="MarkerPacket.html">MarkerPacket</a></li><li><a href="Message.html">Message</a></li><li><a href="module-key_Subkey-Subkey.html">Subkey</a></li><li><a href="module-key_User-User.html">User</a></li><li><a href="module-type_kdf_params-KDFParams.html">KDFParams</a></li><li><a href="module-type_keyid-KeyID.html">KeyID</a></li><li><a href="module-type_s2k-GenericS2K.html">GenericS2K</a></li><li><a href="OnePassSignaturePacket.html">OnePassSignaturePacket</a></li><li><a href="PacketList.html">PacketList</a></li><li><a href="PaddingPacket.html">PaddingPacket</a></li><li><a href="PrivateKey.html">PrivateKey</a></li><li><a href="PublicKey.html">PublicKey</a></li><li><a href="PublicKeyEncryptedSessionKeyPacket.html">PublicKeyEncryptedSessionKeyPacket</a></li><li><a href="PublicKeyPacket.html">PublicKeyPacket</a></li><li><a href="PublicSubkeyPacket.html">PublicSubkeyPacket</a></li><li><a href="SecretKeyPacket.html">SecretKeyPacket</a></li><li><a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a></li><li><a href="Signature.html">Signature</a></li><li><a href="SignaturePacket.html">SignaturePacket</a></li><li><a href="SymEncryptedIntegrityProtectedDataPacket.html">SymEncryptedIntegrityProtectedDataPacket</a></li><li><a href="SymEncryptedSessionKeyPacket.html">SymEncryptedSessionKeyPacket</a></li><li><a href="SymmetricallyEncryptedDataPacket.html">SymmetricallyEncryptedDataPacket</a></li><li><a href="TrustPacket.html">TrustPacket</a></li><li><a href="UserAttributePacket.html">UserAttributePacket</a></li><li><a href="UserIDPacket.html">UserIDPacket</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a>
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>