|
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
|
3 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #ifndef mozilla_psm_AppsTrustDomain_h |
|
8 #define mozilla_psm_AppsTrustDomain_h |
|
9 |
|
10 #include "pkix/pkixtypes.h" |
|
11 #include "nsDebug.h" |
|
12 #include "nsIX509CertDB.h" |
|
13 |
|
14 namespace mozilla { namespace psm { |
|
15 |
|
16 class AppTrustDomain MOZ_FINAL : public mozilla::pkix::TrustDomain |
|
17 { |
|
18 public: |
|
19 AppTrustDomain(void* pinArg); |
|
20 |
|
21 SECStatus SetTrustedRoot(AppTrustedRoot trustedRoot); |
|
22 |
|
23 SECStatus GetCertTrust(mozilla::pkix::EndEntityOrCA endEntityOrCA, |
|
24 SECOidTag policy, |
|
25 const CERTCertificate* candidateCert, |
|
26 /*out*/ TrustLevel* trustLevel) MOZ_OVERRIDE; |
|
27 SECStatus FindPotentialIssuers(const SECItem* encodedIssuerName, |
|
28 PRTime time, |
|
29 /*out*/ mozilla::pkix::ScopedCERTCertList& results) |
|
30 MOZ_OVERRIDE; |
|
31 SECStatus VerifySignedData(const CERTSignedData* signedData, |
|
32 const CERTCertificate* cert) MOZ_OVERRIDE; |
|
33 SECStatus CheckRevocation(mozilla::pkix::EndEntityOrCA endEntityOrCA, |
|
34 const CERTCertificate* cert, |
|
35 /*const*/ CERTCertificate* issuerCertToDup, |
|
36 PRTime time, |
|
37 /*optional*/ const SECItem* stapledOCSPresponse); |
|
38 SECStatus IsChainValid(const CERTCertList* certChain) { return SECSuccess; } |
|
39 |
|
40 private: |
|
41 void* mPinArg; // non-owning! |
|
42 mozilla::pkix::ScopedCERTCertificate mTrustedRoot; |
|
43 }; |
|
44 |
|
45 } } // namespace mozilla::psm |
|
46 |
|
47 #endif // mozilla_psm_AppsTrustDomain_h |