2014-02-15 02:37:07 +04: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-21 01:29:21 +04:00
|
|
|
#include "pkix/pkixtypes.h"
|
2014-02-15 02:37:07 +04:00
|
|
|
#include "nsDebug.h"
|
|
|
|
#include "nsIX509CertDB.h"
|
2014-07-04 08:49:56 +04:00
|
|
|
#include "ScopedNSSTypes.h"
|
2014-02-15 02:37:07 +04:00
|
|
|
|
|
|
|
namespace mozilla { namespace psm {
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class AppTrustDomain final : public mozilla::pkix::TrustDomain
|
2014-02-15 02:37:07 +04:00
|
|
|
{
|
|
|
|
public:
|
2014-07-18 22:48:49 +04:00
|
|
|
typedef mozilla::pkix::Result Result;
|
|
|
|
|
2014-07-07 02:55:38 +04:00
|
|
|
AppTrustDomain(ScopedCERTCertList&, void* pinArg);
|
2014-02-15 02:37:07 +04:00
|
|
|
|
|
|
|
SECStatus SetTrustedRoot(AppTrustedRoot trustedRoot);
|
|
|
|
|
2014-07-18 22:48:49 +04:00
|
|
|
virtual Result GetCertTrust(mozilla::pkix::EndEntityOrCA endEntityOrCA,
|
|
|
|
const mozilla::pkix::CertPolicyId& policy,
|
2014-07-31 23:17:31 +04:00
|
|
|
mozilla::pkix::Input candidateCertDER,
|
2014-07-20 22:06:26 +04:00
|
|
|
/*out*/ mozilla::pkix::TrustLevel& trustLevel)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2014-07-31 23:17:31 +04:00
|
|
|
virtual Result FindIssuer(mozilla::pkix::Input encodedIssuerName,
|
2014-07-18 22:48:49 +04:00
|
|
|
IssuerChecker& checker,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::pkix::Time time) override;
|
2014-07-18 22:48:49 +04:00
|
|
|
virtual Result CheckRevocation(mozilla::pkix::EndEntityOrCA endEntityOrCA,
|
2014-08-02 19:49:12 +04:00
|
|
|
const mozilla::pkix::CertID& certID,
|
|
|
|
mozilla::pkix::Time time,
|
2015-04-07 02:10:28 +03:00
|
|
|
mozilla::pkix::Duration validityDuration,
|
2014-07-31 23:17:31 +04:00
|
|
|
/*optional*/ const mozilla::pkix::Input* stapledOCSPresponse,
|
2015-03-21 19:28:04 +03:00
|
|
|
/*optional*/ const mozilla::pkix::Input* aiaExtension) override;
|
2014-09-25 22:18:56 +04:00
|
|
|
virtual Result IsChainValid(const mozilla::pkix::DERArray& certChain,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::pkix::Time time) override;
|
2015-02-15 03:59:02 +03:00
|
|
|
virtual Result CheckSignatureDigestAlgorithm(
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::pkix::DigestAlgorithm digestAlg) override;
|
2015-02-03 03:17:08 +03:00
|
|
|
virtual Result CheckRSAPublicKeyModulusSizeInBits(
|
|
|
|
mozilla::pkix::EndEntityOrCA endEntityOrCA,
|
2015-03-21 19:28:04 +03:00
|
|
|
unsigned int modulusSizeInBits) override;
|
2015-02-07 23:14:31 +03:00
|
|
|
virtual Result VerifyRSAPKCS1SignedDigest(
|
|
|
|
const mozilla::pkix::SignedDigest& signedDigest,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::pkix::Input subjectPublicKeyInfo) override;
|
2015-02-03 03:17:08 +03:00
|
|
|
virtual Result CheckECDSACurveIsAcceptable(
|
|
|
|
mozilla::pkix::EndEntityOrCA endEntityOrCA,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::pkix::NamedCurve curve) override;
|
2015-02-07 23:14:31 +03:00
|
|
|
virtual Result VerifyECDSASignedDigest(
|
|
|
|
const mozilla::pkix::SignedDigest& signedDigest,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::pkix::Input subjectPublicKeyInfo) override;
|
2014-07-31 23:17:31 +04:00
|
|
|
virtual Result DigestBuf(mozilla::pkix::Input item,
|
2015-02-07 23:14:31 +03:00
|
|
|
mozilla::pkix::DigestAlgorithm digestAlg,
|
2014-07-19 09:30:51 +04:00
|
|
|
/*out*/ uint8_t* digestBuf,
|
2015-03-21 19:28:04 +03:00
|
|
|
size_t digestBufLen) override;
|
2014-07-07 06:36:05 +04:00
|
|
|
|
2014-02-15 02:37:07 +04:00
|
|
|
private:
|
2014-07-07 02:55:38 +04:00
|
|
|
/*out*/ ScopedCERTCertList& mCertChain;
|
2014-02-15 02:37:07 +04:00
|
|
|
void* mPinArg; // non-owning!
|
2014-07-04 08:49:56 +04:00
|
|
|
ScopedCERTCertificate mTrustedRoot;
|
2015-03-05 18:41:00 +03:00
|
|
|
unsigned int mMinRSABits;
|
2014-02-15 02:37:07 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} } // namespace mozilla::psm
|
|
|
|
|
|
|
|
#endif // mozilla_psm_AppsTrustDomain_h
|