michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: const Ci = Components.interfaces; michael@0: const Cu = Components.utils; michael@0: michael@0: this.EXPORTED_SYMBOLS = [ michael@0: "TrustedRootCertificate" michael@0: ]; michael@0: michael@0: const APP_TRUSTED_ROOTS= ["AppMarketplaceProdPublicRoot", michael@0: "AppMarketplaceProdReviewersRoot", michael@0: "AppMarketplaceDevPublicRoot", michael@0: "AppMarketplaceDevReviewersRoot", michael@0: "AppXPCShellRoot"]; michael@0: michael@0: this.TrustedRootCertificate = { michael@0: _index: Ci.nsIX509CertDB.AppMarketplaceProdPublicRoot, michael@0: get index() { michael@0: return this._index; michael@0: }, michael@0: set index(aIndex) { michael@0: // aIndex should be one of the michael@0: // Ci.nsIX509CertDB AppTrustedRoot defined values michael@0: let found = APP_TRUSTED_ROOTS.some((trustRoot) => { michael@0: return Ci.nsIX509CertDB[trustRoot] === aIndex; michael@0: }); michael@0: if (found) { michael@0: this._index = aIndex; michael@0: } michael@0: } michael@0: }; michael@0: