2014-02-14 14:37:07 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_psm_AppsTrustDomain_h
|
|
|
|
#define mozilla_psm_AppsTrustDomain_h
|
|
|
|
|
2014-03-20 14:29:21 -07:00
|
|
|
#include "pkix/pkixtypes.h"
|
2014-02-14 14:37:07 -08:00
|
|
|
#include "nsDebug.h"
|
|
|
|
#include "nsIX509CertDB.h"
|
2014-07-03 21:49:56 -07:00
|
|
|
#include "ScopedNSSTypes.h"
|
2014-02-14 14:37:07 -08:00
|
|
|
|
|
|
|
namespace mozilla { namespace psm {
|
|
|
|
|
2014-03-20 14:29:21 -07:00
|
|
|
class AppTrustDomain MOZ_FINAL : public mozilla::pkix::TrustDomain
|
2014-02-14 14:37:07 -08:00
|
|
|
{
|
|
|
|
public:
|
2014-07-18 11:48:49 -07:00
|
|
|
typedef mozilla::pkix::Result Result;
|
|
|
|
|
2014-07-06 15:55:38 -07:00
|
|
|
AppTrustDomain(ScopedCERTCertList&, void* pinArg);
|
2014-02-14 14:37:07 -08:00
|
|
|
|
|
|
|
SECStatus SetTrustedRoot(AppTrustedRoot trustedRoot);
|
|
|
|
|
2014-07-18 11:48:49 -07:00
|
|
|
virtual Result GetCertTrust(mozilla::pkix::EndEntityOrCA endEntityOrCA,
|
|
|
|
const mozilla::pkix::CertPolicyId& policy,
|
2014-07-31 12:17:31 -07:00
|
|
|
mozilla::pkix::Input candidateCertDER,
|
2014-07-20 11:06:26 -07:00
|
|
|
/*out*/ mozilla::pkix::TrustLevel& trustLevel)
|
2014-07-18 11:48:49 -07:00
|
|
|
MOZ_OVERRIDE;
|
2014-07-31 12:17:31 -07:00
|
|
|
virtual Result FindIssuer(mozilla::pkix::Input encodedIssuerName,
|
2014-07-18 11:48:49 -07:00
|
|
|
IssuerChecker& checker,
|
2014-08-02 08:49:12 -07:00
|
|
|
mozilla::pkix::Time time) MOZ_OVERRIDE;
|
2014-07-18 11:48:49 -07:00
|
|
|
virtual Result CheckRevocation(mozilla::pkix::EndEntityOrCA endEntityOrCA,
|
2014-08-02 08:49:12 -07:00
|
|
|
const mozilla::pkix::CertID& certID,
|
|
|
|
mozilla::pkix::Time time,
|
2014-07-31 12:17:31 -07:00
|
|
|
/*optional*/ const mozilla::pkix::Input* stapledOCSPresponse,
|
|
|
|
/*optional*/ const mozilla::pkix::Input* aiaExtension);
|
2014-07-18 11:48:49 -07:00
|
|
|
virtual Result IsChainValid(const mozilla::pkix::DERArray& certChain)
|
|
|
|
MOZ_OVERRIDE;
|
2014-07-31 12:17:31 -07:00
|
|
|
virtual Result CheckPublicKey(mozilla::pkix::Input subjectPublicKeyInfo)
|
2014-07-18 11:48:49 -07:00
|
|
|
MOZ_OVERRIDE;
|
|
|
|
virtual Result VerifySignedData(
|
|
|
|
const mozilla::pkix::SignedDataWithSignature& signedData,
|
2014-07-31 12:17:31 -07:00
|
|
|
mozilla::pkix::Input subjectPublicKeyInfo) MOZ_OVERRIDE;
|
|
|
|
virtual Result DigestBuf(mozilla::pkix::Input item,
|
2014-07-18 22:30:51 -07:00
|
|
|
/*out*/ uint8_t* digestBuf,
|
2014-07-18 11:48:49 -07:00
|
|
|
size_t digestBufLen) MOZ_OVERRIDE;
|
2014-07-06 19:36:05 -07:00
|
|
|
|
2014-02-14 14:37:07 -08:00
|
|
|
private:
|
2014-07-06 15:55:38 -07:00
|
|
|
/*out*/ ScopedCERTCertList& mCertChain;
|
2014-02-14 14:37:07 -08:00
|
|
|
void* mPinArg; // non-owning!
|
2014-07-03 21:49:56 -07:00
|
|
|
ScopedCERTCertificate mTrustedRoot;
|
2014-02-14 14:37:07 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
} } // namespace mozilla::psm
|
|
|
|
|
|
|
|
#endif // mozilla_psm_AppsTrustDomain_h
|