<!DOCTYPE html><html lang="en"><head> <meta charset="utf-8"> <title>JSDoc: Class: PublicSubkeyPacket</title>
<script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <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: PublicSubkeyPacket</h1>
<section>
<header> <h2><span class="attribs"><span class="type-signature"></span></span>PublicSubkeyPacket<span class="signature">(date<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h2> <div class="class-description"><p>A Public-Subkey packet (tag 14) has exactly the same format as aPublic-Key packet, but denotes a subkey. One or more subkeys may beassociated with a top-level key. By convention, the top-level keyprovides signature services, and the subkeys provide encryptionservices.</p></div> </header>
<article> <div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="PublicSubkeyPacket"><span class="type-signature"></span>new PublicSubkeyPacket<span class="signature">(date<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<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"> <optional><br>
</td>
<td class="description last"><p>Creation date</p></td> </tr>
<tr> <td class="name"><code>config</code></td>
<td class="type"> <span class="param-type">Object</span>
</td>
<td class="attributes"> <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/v5.3.0/src/packet/public_subkey.js">packet/public_subkey.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_subkey.js#L39">line 39</a> </li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Extends</h3>
<ul> <li><a href="PublicKeyPacket.html">PublicKeyPacket</a></li> </ul>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="algorithm"><span class="type-signature"></span>algorithm<span class="type-signature"> :enums.publicKey</span></h4>
<div class="description"> <p>Public key algorithm.</p></div>
<h5>Type:</h5> <ul> <li> <span class="param-type">enums.publicKey</span>
</li> </ul>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="PublicKeyPacket.html#algorithm">PublicKeyPacket#algorithm</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L60">line 60</a> </li></ul></dd>
</dl>
<h4 class="name" id="created"><span class="type-signature"></span>created<span class="type-signature"> :Date</span></h4>
<div class="description"> <p>Key creation date.</p></div>
<h5>Type:</h5> <ul> <li> <span class="param-type">Date</span>
</li> </ul>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="PublicKeyPacket.html#created">PublicKeyPacket#created</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L55">line 55</a> </li></ul></dd>
</dl>
<h4 class="name" id="expirationTimeV3"><span class="type-signature"></span>expirationTimeV3<span class="type-signature"> :Integer</span></h4>
<div class="description"> <p>Time until expiration in days (V3 only)</p></div>
<h5>Type:</h5> <ul> <li> <span class="param-type">Integer</span>
</li> </ul>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="PublicKeyPacket.html#expirationTimeV3">PublicKeyPacket#expirationTimeV3</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L70">line 70</a> </li></ul></dd>
</dl>
<h4 class="name" id="fingerprint"><span class="type-signature"></span>fingerprint<span class="type-signature"> :Uint8Array</span></h4>
<div class="description"> <p>Fingerprint bytes</p></div>
<h5>Type:</h5> <ul> <li> <span class="param-type">Uint8Array</span>
</li> </ul>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="PublicKeyPacket.html#fingerprint">PublicKeyPacket#fingerprint</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L75">line 75</a> </li></ul></dd>
</dl>
<h4 class="name" id="keyID"><span class="type-signature"></span>keyID<span class="type-signature"> :<a href="module-type_keyid-KeyID.html">module:type/keyid~KeyID</a></span></h4>
<div class="description"> <p>KeyID</p></div>
<h5>Type:</h5> <ul> <li> <span class="param-type"><a href="module-type_keyid-KeyID.html">module:type/keyid~KeyID</a></span>
</li> </ul>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="PublicKeyPacket.html#keyID">PublicKeyPacket#keyID</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L80">line 80</a> </li></ul></dd>
</dl>
<h4 class="name" id="publicParams"><span class="type-signature"></span>publicParams<span class="type-signature"> :Object</span></h4>
<div class="description"> <p>Algorithm specific public params</p></div>
<h5>Type:</h5> <ul> <li> <span class="param-type">Object</span>
</li> </ul>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="PublicKeyPacket.html#publicParams">PublicKeyPacket#publicParams</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L65">line 65</a> </li></ul></dd>
</dl>
<h4 class="name" id="readPublicKey"><span class="type-signature"></span>readPublicKey<span class="type-signature"></span></h4>
<div class="description"> <p>Alias of read()</p></div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="PublicKeyPacket.html#readPublicKey">PublicKeyPacket#readPublicKey</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L274">line 274</a> </li></ul></dd>
<dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="PublicKeyPacket.html#read">PublicKeyPacket#read</a></li> </ul> </dd>
</dl>
<h4 class="name" id="version"><span class="type-signature"></span>version<span class="type-signature"> :Integer</span></h4>
<div class="description"> <p>Packet version</p></div>
<h5>Type:</h5> <ul> <li> <span class="param-type">Integer</span>
</li> </ul>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="PublicKeyPacket.html#version">PublicKeyPacket#version</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L50">line 50</a> </li></ul></dd>
</dl>
<h4 class="name" id="writePublicKey"><span class="type-signature"></span>writePublicKey<span class="type-signature"></span></h4>
<div class="description"> <p>Alias of write()</p></div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="PublicKeyPacket.html#writePublicKey">PublicKeyPacket#writePublicKey</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L280">line 280</a> </li></ul></dd>
<dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="PublicKeyPacket.html#write">PublicKeyPacket#write</a></li> </ul> </dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".fromSecretSubkeyPacket"><span class="type-signature">(static) </span>fromSecretSubkeyPacket<span class="signature">(secretSubkeyPacket)</span><span class="type-signature"> → {<a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a>}</span></h4>
<div class="description"> <p>Create a PublicSubkeyPacket from a SecretSubkeyPacket</p></div>
<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>secretSubkeyPacket</code></td>
<td class="type"> <span class="param-type"><a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a></span>
</td>
<td class="description last"><p>subkey packet to convert</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/v5.3.0/src/packet/public_subkey.js">packet/public_subkey.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_subkey.js#L49">line 49</a> </li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc"> <p>public key packet</p></div>
<dl> <dt> Type </dt> <dd> <span class="param-type"><a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a></span>
</dd></dl>
<h4 class="name" id="computeFingerprint"><span class="type-signature">(async) </span>computeFingerprint<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description"> <p>Computes and set the fingerprint 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#computeFingerprint">PublicKeyPacket#computeFingerprint</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L216">line 216</a> </li></ul></dd>
</dl>
<h4 class="name" id="computeFingerprintAndKeyID"><span class="type-signature">(async) </span>computeFingerprintAndKeyID<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description"> <p>Computes and set the key ID and fingerprint 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#computeFingerprintAndKeyID">PublicKeyPacket#computeFingerprintAndKeyID</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L200">line 200</a> </li></ul></dd>
</dl>
<h4 class="name" id="getAlgorithmInfo"><span class="type-signature"></span>getAlgorithmInfo<span class="signature">()</span><span class="type-signature"> → {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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L256">line 256</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"> → {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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L184">line 184</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="getFingerprint"><span class="type-signature"></span>getFingerprint<span class="signature">()</span><span class="type-signature"> → {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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L240">line 240</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="getFingerprintBytes"><span class="type-signature"></span>getFingerprintBytes<span class="signature">()</span><span class="type-signature"> → {Uint8Array}</span></h4>
<div class="description"> <p>Returns the fingerprint of the key, as an array of bytes</p></div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="PublicKeyPacket.html#getFingerprintBytes">PublicKeyPacket#getFingerprintBytes</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L232">line 232</a> </li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc"> <p>A Uint8Array containing the fingerprint</p></div>
<dl> <dt> Type </dt> <dd> <span class="param-type">Uint8Array</span>
</dd></dl>
<h4 class="name" id="getKeyID"><span class="type-signature"></span>getKeyID<span class="signature">()</span><span class="type-signature"> → {<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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L192">line 192</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"> → {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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L248">line 248</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"> → {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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L176">line 176</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="read"><span class="type-signature">(async) </span>read<span class="signature">(bytes)</span><span class="type-signature"> → {Object}</span></h4>
<div class="description"> <p>Internal Parser for public keys as specified in <a href="https://tools.ietf.org/html/rfc4880#section-5.5.2">RFC 4880 section 5.5.2 Public-Key Packet Formats</a></p></div>
<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>bytes</code></td>
<td class="type"> <span class="param-type">Uint8Array</span>
</td>
<td class="description last"><p>Input array to read the packet from</p></td> </tr>
</tbody></table>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="PublicKeyPacket.html#read">PublicKeyPacket#read</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L107">line 107</a> </li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc"> <p>This object with attributes set by the parser</p></div>
<dl> <dt> Type </dt> <dd> <span class="param-type">Object</span>
</dd></dl>
<h4 class="name" id="write"><span class="type-signature"></span>write<span class="signature">()</span><span class="type-signature"> → {Uint8Array}</span></h4>
<div class="description"> <p>Creates an OpenPGP public key packet for the given key.</p></div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="PublicKeyPacket.html#write">PublicKeyPacket#write</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L141">line 141</a> </li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc"> <p>Bytes encoding the public key OpenPGP packet.</p></div>
<dl> <dt> Type </dt> <dd> <span class="param-type">Uint8Array</span>
</dd></dl>
<h4 class="name" id="writeForHash"><span class="type-signature"></span>writeForHash<span class="signature">(version)</span><span class="type-signature"></span></h4>
<div class="description"> <p>Write packet in order to be hashed; either for a signature or a fingerprint</p></div>
<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>version</code></td>
<td class="type"> <span class="param-type">Integer</span>
</td>
<td class="description last"><p>target version of signature or key</p></td> </tr>
</tbody></table>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="PublicKeyPacket.html#writeForHash">PublicKeyPacket#writeForHash</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/v5.3.0/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v5.3.0/src/packet/public_key.js#L163">line 163</a> </li></ul></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#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#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#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-enums.html">enums</a></li></ul><h3>Classes</h3><ul><li><a href="AEADEncryptedDataPacket.html">AEADEncryptedDataPacket</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-crypto_random-RandomBuffer.html">RandomBuffer</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-S2K.html">S2K</a></li><li><a href="OnePassSignaturePacket.html">OnePassSignaturePacket</a></li><li><a href="PacketList.html">PacketList</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.4</a></footer>
<script> prettyPrint(); </script><script src="scripts/linenumber.js"> </script></body></html>