ontology-ts-sdk
Version:
Comprehensive TypeScript library for the Ontology blockchain.
766 lines • 43.8 kB
HTML
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Message | ontology-ts-sdk</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">ontology-ts-sdk</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
<input type="checkbox" id="tsd-filter-externals" checked />
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../globals.html">Globals</a>
</li>
<li>
<a href="../modules/_claim_message_.html">"claim/message"</a>
</li>
<li>
<a href="_claim_message_.message.html">Message</a>
</li>
</ul>
<h1>Class Message</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Common representation of Message in JWT form.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">Message</span>
<ul class="tsd-hierarchy">
<li>
<a href="_claim_claim_.claim.html" class="tsd-signature-type">Claim</a>
</li>
</ul>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Constructors</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="_claim_message_.message.html#constructor" class="tsd-kind-icon">constructor</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_claim_message_.message.html#metadata" class="tsd-kind-icon">metadata</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_claim_message_.message.html#signature" class="tsd-kind-icon">signature</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><a href="_claim_message_.message.html#payloadfromjson" class="tsd-kind-icon">payload<wbr>FromJSON</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><a href="_claim_message_.message.html#payloadtojson" class="tsd-kind-icon">payload<wbr>ToJSON</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_claim_message_.message.html#serialize" class="tsd-kind-icon">serialize</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><a href="_claim_message_.message.html#serializeheader" class="tsd-kind-icon">serialize<wbr>Header</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="_claim_message_.message.html#serializepayload" class="tsd-kind-icon">serialize<wbr>Payload</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_claim_message_.message.html#serializeunsigned" class="tsd-kind-icon">serialize<wbr>Unsigned</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_claim_message_.message.html#sign" class="tsd-kind-icon">sign</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_claim_message_.message.html#verify" class="tsd-kind-icon">verify</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="_claim_message_.message.html#verifyexpiration" class="tsd-kind-icon">verify<wbr>Expiration</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="_claim_message_.message.html#verifykeyownership" class="tsd-kind-icon">verify<wbr>Key<wbr>Ownership</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static"><a href="_claim_message_.message.html#deserializeheader" class="tsd-kind-icon">deserialize<wbr>Header</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-protected tsd-is-static"><a href="_claim_message_.message.html#deserializeinternal" class="tsd-kind-icon">deserialize<wbr>Internal</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static"><a href="_claim_message_.message.html#deserializepayload" class="tsd-kind-icon">deserialize<wbr>Payload</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Constructors</h2>
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
<a name="constructor" class="tsd-anchor"></a>
<h3>constructor</h3>
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">new <wbr>Message<span class="tsd-signature-symbol">(</span>metadata<span class="tsd-signature-symbol">: </span><a href="../interfaces/_claim_message_.metadata.html" class="tsd-signature-type">Metadata</a>, signature<span class="tsd-signature-symbol">: </span><a href="_crypto_signature_.signature.html" class="tsd-signature-type">Signature</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_claim_message_.message.html" class="tsd-signature-type">Message</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L142">claim/message.ts:142</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>metadata: <a href="../interfaces/_claim_message_.metadata.html" class="tsd-signature-type">Metadata</a></h5>
</li>
<li>
<h5>signature: <a href="_crypto_signature_.signature.html" class="tsd-signature-type">Signature</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">undefined</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="_claim_message_.message.html" class="tsd-signature-type">Message</a></h4>
</li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="metadata" class="tsd-anchor"></a>
<h3>metadata</h3>
<div class="tsd-signature tsd-kind-icon">metadata<span class="tsd-signature-symbol">:</span> <a href="../interfaces/_claim_message_.metadata.html" class="tsd-signature-type">Metadata</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L141">claim/message.ts:141</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="signature" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> signature</h3>
<div class="tsd-signature tsd-kind-icon">signature<span class="tsd-signature-symbol">:</span> <a href="_crypto_signature_.signature.html" class="tsd-signature-type">Signature</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L142">claim/message.ts:142</a></li>
</ul>
</aside>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-protected">
<a name="payloadfromjson" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagProtected">Protected</span> <span class="tsd-flag ts-flagAbstract">Abstract</span> payload<wbr>FromJSON</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-protected">
<li class="tsd-signature tsd-kind-icon">payload<wbr>FromJSON<span class="tsd-signature-symbol">(</span>json<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L282">claim/message.ts:282</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Retrieves data from JSON.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>json: <span class="tsd-signature-type">any</span></h5>
<div class="tsd-comment tsd-typography">
<p>JSON object with data</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-protected">
<a name="payloadtojson" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagProtected">Protected</span> <span class="tsd-flag ts-flagAbstract">Abstract</span> payload<wbr>ToJSON</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-protected">
<li class="tsd-signature tsd-kind-icon">payload<wbr>ToJSON<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L275">claim/message.ts:275</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Converts claim data to JSON for serialization.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="serialize" class="tsd-anchor"></a>
<h3>serialize</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">serialize<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L234">claim/message.ts:234</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Serializes the message into JWT format.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-protected">
<a name="serializeheader" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagProtected">Protected</span> serialize<wbr>Header</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-protected">
<li class="tsd-signature tsd-kind-icon">serialize<wbr>Header<span class="tsd-signature-symbol">(</span>algorithm<span class="tsd-signature-symbol">: </span><a href="_crypto_signaturescheme_.signaturescheme.html" class="tsd-signature-type">SignatureScheme</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">undefined</span>, publicKeyId<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L251">claim/message.ts:251</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Serializes the header into JWT encoded header.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>algorithm: <a href="_crypto_signaturescheme_.signaturescheme.html" class="tsd-signature-type">SignatureScheme</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">undefined</span></h5>
<div class="tsd-comment tsd-typography">
<p>Signature algorithm used</p>
</div>
</li>
<li>
<h5>publicKeyId: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">undefined</span></h5>
<div class="tsd-comment tsd-typography">
<p>The ID of a signature public key</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private">
<a name="serializepayload" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagPrivate">Private</span> serialize<wbr>Payload</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private">
<li class="tsd-signature tsd-kind-icon">serialize<wbr>Payload<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L313">claim/message.ts:313</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Serializes payload part of JWT message.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="serializeunsigned" class="tsd-anchor"></a>
<h3>serialize<wbr>Unsigned</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">serialize<wbr>Unsigned<span class="tsd-signature-symbol">(</span>algorithm<span class="tsd-signature-symbol">?: </span><a href="_crypto_signaturescheme_.signaturescheme.html" class="tsd-signature-type">SignatureScheme</a>, publicKeyId<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L223">claim/message.ts:223</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Serializes the message without signature into JWT format.</p>
</div>
<p>Header might contain algorithm and public key id.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> algorithm: <a href="_crypto_signaturescheme_.signaturescheme.html" class="tsd-signature-type">SignatureScheme</a></h5>
<div class="tsd-comment tsd-typography">
<p>Signature algorithm used</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> publicKeyId: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The ID of a signature public key</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="sign" class="tsd-anchor"></a>
<h3>sign</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">sign<span class="tsd-signature-symbol">(</span>url<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, publicKeyId<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, privateKey<span class="tsd-signature-symbol">: </span><a href="_crypto_privatekey_.privatekey.html" class="tsd-signature-type">PrivateKey</a>, algorithm<span class="tsd-signature-symbol">?: </span><a href="_crypto_signaturescheme_.signaturescheme.html" class="tsd-signature-type">SignatureScheme</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L163">claim/message.ts:163</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Signs the message and store the signature inside the request.</p>
</div>
<p>If the algorithm is not specified, then default algorithm for Private key type is used.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>url: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>Restful endpoint of Ontology node</p>
</div>
</li>
<li>
<h5>publicKeyId: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The ID of a signature public key</p>
</div>
</li>
<li>
<h5>privateKey: <a href="_crypto_privatekey_.privatekey.html" class="tsd-signature-type">PrivateKey</a></h5>
<div class="tsd-comment tsd-typography">
<p>Private key to sign the request with</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> algorithm: <a href="_crypto_signaturescheme_.signaturescheme.html" class="tsd-signature-type">SignatureScheme</a></h5>
<div class="tsd-comment tsd-typography">
<p>Signature algorithm used</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="verify" class="tsd-anchor"></a>
<h3>verify</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">verify<span class="tsd-signature-symbol">(</span>url<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L185">claim/message.ts:185</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Verifies the signature and check ownership of specified ONT ID through smart contract call.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>url: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>Restful endpoint of Ontology node</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></h4>
<p>Boolean if the ownership is confirmed</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private">
<a name="verifyexpiration" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagPrivate">Private</span> verify<wbr>Expiration</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private">
<li class="tsd-signature tsd-kind-icon">verify<wbr>Expiration<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L287">claim/message.ts:287</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Verifies if the expiration date has passed</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private">
<a name="verifykeyownership" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagPrivate">Private</span> verify<wbr>Key<wbr>Ownership</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private">
<li class="tsd-signature tsd-kind-icon">verify<wbr>Key<wbr>Ownership<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L298">claim/message.ts:298</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Verifies if the declared public key id belongs to issuer.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static">
<a name="deserializeheader" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-flagPrivate">Private</span> deserialize<wbr>Header</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static">
<li class="tsd-signature tsd-kind-icon">deserialize<wbr>Header<span class="tsd-signature-symbol">(</span>encoded<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L131">claim/message.ts:131</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Deserializes the header from JWT encoded header.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>encoded: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>JWT encoded header</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">object</span></h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>algorithm<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="_crypto_signaturescheme_.signaturescheme.html" class="tsd-signature-type">SignatureScheme</a></h5>
</li>
<li class="tsd-parameter">
<h5>public<wbr>Key<wbr>Id<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></h5>
</li>
</ul>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-protected tsd-is-static">
<a name="deserializeinternal" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-flagProtected">Protected</span> deserialize<wbr>Internal</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-protected tsd-is-static">
<li class="tsd-signature tsd-kind-icon">deserialize<wbr>Internal<T><span class="tsd-signature-symbol">(</span>jwt<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, creator<span class="tsd-signature-symbol">: </span><a href="../modules/_claim_message_.html#messagefactory" class="tsd-signature-type">MessageFactory</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">T</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">T</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L81">claim/message.ts:81</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Deserializes the message from JWT format.</p>
</div>
<p>A concrete instance will be creater through the message factory method. This method
is called from concrete class.</p>
</div>
<h4 class="tsd-type-parameters-title">Type parameters</h4>
<ul class="tsd-type-parameters">
<li>
<h4>T<span class="tsd-signature-symbol">: </span><a href="_claim_message_.message.html" class="tsd-signature-type">Message</a></h4>
</li>
</ul>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>jwt: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>Encoded message</p>
</div>
</li>
<li>
<h5>creator: <a href="../modules/_claim_message_.html#messagefactory" class="tsd-signature-type">MessageFactory</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">T</span><span class="tsd-signature-symbol">></span></h5>
<div class="tsd-comment tsd-typography">
<p>Factory method</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">T</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static">
<a name="deserializepayload" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-flagPrivate">Private</span> deserialize<wbr>Payload</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static">
<li class="tsd-signature tsd-kind-icon">deserialize<wbr>Payload<span class="tsd-signature-symbol">(</span>encoded<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MickWang/ontology-ts-sdk/blob/f203ee8/src/claim/message.ts#L110">claim/message.ts:110</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Deserializes payload part of JWT message.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>encoded: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>JWT encoded payload</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">object</span></h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>metadata<span class="tsd-signature-symbol">: </span><a href="../interfaces/_claim_message_.metadata.html" class="tsd-signature-type">Metadata</a></h5>
</li>
<li class="tsd-parameter">
<h5>rest<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></h5>
</li>
</ul>
</li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../globals.html"><em>Globals</em></a>
</li>
<li class="current tsd-kind-external-module">
<a href="../modules/_claim_message_.html">"claim/message"</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
</ul>
<ul class="current">
<li class="current tsd-kind-class tsd-parent-kind-external-module">
<a href="_claim_message_.message.html" class="tsd-kind-icon">Message</a>
<ul>
<li class=" tsd-kind-constructor tsd-parent-kind-class">
<a href="_claim_message_.message.html#constructor" class="tsd-kind-icon">constructor</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="_claim_message_.message.html#metadata" class="tsd-kind-icon">metadata</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="_claim_message_.message.html#signature" class="tsd-kind-icon">signature</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-protected">
<a href="_claim_message_.message.html#payloadfromjson" class="tsd-kind-icon">payload<wbr>FromJSON</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-protected">
<a href="_claim_message_.message.html#payloadtojson" class="tsd-kind-icon">payload<wbr>ToJSON</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="_claim_message_.message.html#serialize" class="tsd-kind-icon">serialize</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-protected">
<a href="_claim_message_.message.html#serializeheader" class="tsd-kind-icon">serialize<wbr>Header</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-private">
<a href="_claim_message_.message.html#serializepayload" class="tsd-kind-icon">serialize<wbr>Payload</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="_claim_message_.message.html#serializeunsigned" class="tsd-kind-icon">serialize<wbr>Unsigned</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="_claim_message_.message.html#sign" class="tsd-kind-icon">sign</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="_claim_message_.message.html#verify" class="tsd-kind-icon">verify</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-private">
<a href="_claim_message_.message.html#verifyexpiration" class="tsd-kind-icon">verify<wbr>Expiration</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-private">
<a href="_claim_message_.message.html#verifykeyownership" class="tsd-kind-icon">verify<wbr>Key<wbr>Ownership</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static">
<a href="_claim_message_.message.html#deserializeheader" class="tsd-kind-icon">deserialize<wbr>Header</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-protected tsd-is-static">
<a href="_claim_message_.message.html#deserializeinternal" class="tsd-kind-icon">deserialize<wbr>Internal</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static">
<a href="_claim_message_.message.html#deserializepayload" class="tsd-kind-icon">deserialize<wbr>Payload</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="../interfaces/_claim_message_.metadata.html" class="tsd-kind-icon">Metadata</a>
</li>
<li class=" tsd-kind-type-alias tsd-parent-kind-external-module tsd-has-type-parameter">
<a href="../modules/_claim_message_.html#messagefactory" class="tsd-kind-icon">Message<wbr>Factory</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module">
<a href="../modules/_claim_message_.html#extractkeyid" class="tsd-kind-icon">extract<wbr>Key<wbr>Id</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module">
<a href="../modules/_claim_message_.html#extractontid" class="tsd-kind-icon">extract<wbr>Ont<wbr>Id</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module">
<a href="../modules/_claim_message_.html#retrievepublickey" class="tsd-kind-icon">retrieve<wbr>Public<wbr>Key</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module">
<a href="../modules/_claim_message_.html#retrievepublickeystate" class="tsd-kind-icon">retrieve<wbr>Public<wbr>Key<wbr>State</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer class="with-border-bottom">
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
</ul>
</div>
</div>
</footer>
<div class="container tsd-generator">
<p>Generated using <a href="http://typedoc.org/" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
</body>
</html>