cordova-plugin-mas-core-mba
Version:
Cordova MAS Foundation Plugin
949 lines (216 loc) • 11 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#line45">line 45</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#line55">line 55</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#line75">line 75</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#line25">line 25</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#line35">line 35</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#line65">line 65</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="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/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Oct 29 2018 19:12:28 GMT+0530 (India Standard Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>