Bumping manifests a=b2g-bump
[gecko.git] / dom / apps / StoreTrustAnchor.jsm
blob77c43796fbb9400ed77db3b3d35dd55e30b09372
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3  * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 "use strict";
7 const Ci = Components.interfaces;
8 const Cu = Components.utils;
10 this.EXPORTED_SYMBOLS = [
11   "TrustedRootCertificate"
14 const APP_TRUSTED_ROOTS= ["AppMarketplaceProdPublicRoot",
15                           "AppMarketplaceProdReviewersRoot",
16                           "AppMarketplaceDevPublicRoot",
17                           "AppMarketplaceDevReviewersRoot",
18                           "AppMarketplaceStageRoot",
19                           "TrustedHostedAppPublicRoot",
20                           "TrustedHostedAppTestRoot",
21                           "AppXPCShellRoot"];
23 this.TrustedRootCertificate = {
24   _index: Ci.nsIX509CertDB.AppMarketplaceProdPublicRoot,
25   get index() {
26     return this._index;
27   },
28   set index(aIndex) {
29     // aIndex should be one of the
30     // Ci.nsIX509CertDB AppTrustedRoot defined values
31     let found = APP_TRUSTED_ROOTS.some((trustRoot) => {
32       return Ci.nsIX509CertDB[trustRoot] === aIndex;
33     });
34     if (found) {
35       this._index = aIndex;
36     }
37   }