cordova-plugin-mas-core
Version:
Cordova MAS Foundation Plugin
1,270 lines (291 loc) • 15 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: MASPluginSecurityConfiguration</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: MASPluginSecurityConfiguration</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>MASPluginSecurityConfiguration</h2>
<div class="class-description">A class to set MAS Security Configuration for a server based on the trust settings.
<table>
<tr bgcolor="#D3D3D3"><th>MASPluginSecurityConfiguration Constructor</th></tr>
<tr><td><i>var MASSecurityConfiguration = new MASPlugin.MASSecurityConfiguration();</td></tr>
</table></div>
</header>
<article>
<div class="container-overview">
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginSecurityConfiguration.js.html">MASPluginSecurityConfiguration.js</a>, <a href="MASPluginSecurityConfiguration.js.html#line8">line 8</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="addCertificate"><span class="type-signature"></span>addCertificate<span class="signature">(certificate)</span><span class="type-signature"></span></h4>
<div class="description">
Set the certificate of the host server
</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>certificate</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The pinned certificate in Base64 string format</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginSecurityConfiguration.js.html">MASPluginSecurityConfiguration.js</a>, <a href="MASPluginSecurityConfiguration.js.html#line48">line 48</a>
</li></ul></dd>
</dl>
<h4 class="name" id="addPublicKeyHash"><span class="type-signature"></span>addPublicKeyHash<span class="signature">(publicKeyHash)</span><span class="type-signature"></span></h4>
<div class="description">
Set the public keys of the host server
</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>publicKeyHash</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">String value in Base64 of the pinned public key hash.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginSecurityConfiguration.js.html">MASPluginSecurityConfiguration.js</a>, <a href="MASPluginSecurityConfiguration.js.html#line58">line 58</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getSecurityConfiguration"><span class="type-signature"></span>getSecurityConfiguration<span class="signature">()</span><span class="type-signature"> → {Object}</span></h4>
<div class="description">
Gets the final MASSecurityConfiguration as a JSON object
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginSecurityConfiguration.js.html">MASPluginSecurityConfiguration.js</a>, <a href="MASPluginSecurityConfiguration.js.html#line91">line 91</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
MASSecurityConfiguration object<br> Example output -- <br>{<br> host:gw.ca.com:443,<br> isPublic:false,<br> certificates:[Jcnjd...],<br> trustPublicPKI:true<br>}
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="setHost"><span class="type-signature"></span>setHost<span class="signature">(host)</span><span class="type-signature"></span></h4>
<div class="description">
Set the host of the server that you want to connect
</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>host</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Uri object containing the hostname, and port number.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginSecurityConfiguration.js.html">MASPluginSecurityConfiguration.js</a>, <a href="MASPluginSecurityConfiguration.js.html#line28">line 28</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setPinningMode"><span class="type-signature"></span>setPinningMode<span class="signature">(pinningMode)</span><span class="type-signature"></span></h4>
<div class="description">
Set the SSL Pinning mode needed.
</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>pinningMode</code></td>
<td class="type">
<span class="param-type">MASSecuritySSLPinningMode</span>
</td>
<td class="description last">enum value to specify the type of SSL pinning needed.
The Certifcates array needs to be set accordingly with the certificates that needs to be pinned.
If MASSecuritySSLPinningModeIntermediateCertifcate is chosen, then the certificates array should contain intermediate certificate.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginSecurityConfiguration.js.html">MASPluginSecurityConfiguration.js</a>, <a href="MASPluginSecurityConfiguration.js.html#line78">line 78</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setPublic"><span class="type-signature"></span>setPublic<span class="signature">(isPublic)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the public/private scope of the server.
</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>isPublic</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">Boolean value that specifes whether the server is public or not.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginSecurityConfiguration.js.html">MASPluginSecurityConfiguration.js</a>, <a href="MASPluginSecurityConfiguration.js.html#line38">line 38</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setTrustPublicPKI"><span class="type-signature"></span>setTrustPublicPKI<span class="signature">(trustPublicPKI)</span><span class="type-signature"></span></h4>
<div class="description">
Determines whether to trust Public PKI for the host server.
</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>trustPublicPKI</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">Boolean value to trust, or not to trust the public PKI. If false, provide either the certificate, or the publicKeyHash.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginSecurityConfiguration.js.html">MASPluginSecurityConfiguration.js</a>, <a href="MASPluginSecurityConfiguration.js.html#line68">line 68</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<h4 class="name" id=".MASSecuritySSLPinningMode">MASSecuritySSLPinningMode</h4>
<div class="description">
The constant which specifies the SSL pinning mode that can be opted.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>MASSecuritySSLPinningModePublicKeyHash</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">SSL Pinning based on Public Key Hash</td>
</tr>
<tr>
<td class="name"><code>MASSecuritySSLPinningModeCertificate</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">SSL pinning based on Leaf Certificate</td>
</tr>
<tr>
<td class="name"><code>MASSecuritySSLPinningModeIntermediateCertificate</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">SSL pinning based on Intermediate Certificate</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginConstants.js.html">MASPluginConstants.js</a>, <a href="MASPluginConstants.js.html#line90">line 90</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="MASPlugin.html">MASPlugin</a></li><li><a href="MASPluginApplication.html">MASPluginApplication</a></li><li><a href="MASPluginAuthProviders.html">MASPluginAuthProviders</a></li><li><a href="MASPluginConstants.html">MASPluginConstants</a></li><li><a href="MASPluginDevice.html">MASPluginDevice</a></li><li><a href="MASPluginMAS.html">MASPluginMAS</a></li><li><a href="MASPluginMultipartForm.html">MASPluginMultipartForm</a></li><li><a href="MASPluginSecurityConfiguration.html">MASPluginSecurityConfiguration</a></li><li><a href="MASPluginUser.html">MASPluginUser</a></li><li><a href="MASPluginUtils.html">MASPluginUtils</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Tue Feb 18 2020 21:13:36 GMT+0530 (India Standard Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>