1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/apps/AppTrustDomain.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,47 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef mozilla_psm_AppsTrustDomain_h 1.11 +#define mozilla_psm_AppsTrustDomain_h 1.12 + 1.13 +#include "pkix/pkixtypes.h" 1.14 +#include "nsDebug.h" 1.15 +#include "nsIX509CertDB.h" 1.16 + 1.17 +namespace mozilla { namespace psm { 1.18 + 1.19 +class AppTrustDomain MOZ_FINAL : public mozilla::pkix::TrustDomain 1.20 +{ 1.21 +public: 1.22 + AppTrustDomain(void* pinArg); 1.23 + 1.24 + SECStatus SetTrustedRoot(AppTrustedRoot trustedRoot); 1.25 + 1.26 + SECStatus GetCertTrust(mozilla::pkix::EndEntityOrCA endEntityOrCA, 1.27 + SECOidTag policy, 1.28 + const CERTCertificate* candidateCert, 1.29 + /*out*/ TrustLevel* trustLevel) MOZ_OVERRIDE; 1.30 + SECStatus FindPotentialIssuers(const SECItem* encodedIssuerName, 1.31 + PRTime time, 1.32 + /*out*/ mozilla::pkix::ScopedCERTCertList& results) 1.33 + MOZ_OVERRIDE; 1.34 + SECStatus VerifySignedData(const CERTSignedData* signedData, 1.35 + const CERTCertificate* cert) MOZ_OVERRIDE; 1.36 + SECStatus CheckRevocation(mozilla::pkix::EndEntityOrCA endEntityOrCA, 1.37 + const CERTCertificate* cert, 1.38 + /*const*/ CERTCertificate* issuerCertToDup, 1.39 + PRTime time, 1.40 + /*optional*/ const SECItem* stapledOCSPresponse); 1.41 + SECStatus IsChainValid(const CERTCertList* certChain) { return SECSuccess; } 1.42 + 1.43 +private: 1.44 + void* mPinArg; // non-owning! 1.45 + mozilla::pkix::ScopedCERTCertificate mTrustedRoot; 1.46 +}; 1.47 + 1.48 +} } // namespace mozilla::psm 1.49 + 1.50 +#endif // mozilla_psm_AppsTrustDomain_h