Bug 1869043 allow a device to be specified with MediaTrackGraph::NotifyWhenDeviceStar...
[gecko.git] / security / ct / CTDiversityPolicy.h
blob783e5f6db1f13a86d470809b122f297e3db1dc06
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/. */
7 #ifndef CTDiversityPolicy_h
8 #define CTDiversityPolicy_h
10 #include "CTLog.h"
11 #include "CTVerifyResult.h"
12 #include "certt.h"
13 #include "nsTArray.h"
14 #include "mozpkix/Result.h"
16 namespace mozilla {
17 namespace ct {
19 // Retuns the list of unique CT log operator IDs appearing in the provided
20 // list of verified SCTs.
21 void GetCTLogOperatorsFromVerifiedSCTList(const VerifiedSCTList& list,
22 CTLogOperatorList& operators);
24 // Helper class used by CTPolicyEnforcer to check the CT log operators
25 // diversity requirements of the CT Policy.
26 // See CTPolicyEnforcer.h for more details.
27 class CTDiversityPolicy {
28 public:
29 // Given a certificate chain and a set of CT log operators,
30 // returns the subset of log operators that are dependent on the CA
31 // issuing the certificate (as defined by the CT Policy).
33 // NOTE: TBD, PENDING FINALIZATION OF MOZILLA CT POLICY.
34 pkix::Result GetDependentOperators(
35 const nsTArray<nsTArray<uint8_t>>& builtChain,
36 const CTLogOperatorList& operators,
37 CTLogOperatorList& dependentOperators);
40 } // namespace ct
41 } // namespace mozilla
43 #endif // CTDiversityPolicy_h