Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef _NSUSAGEARRAYHELPER_H_
6 #define _NSUSAGEARRAYHELPER_H_
8 #include "CertVerifier.h"
9 #include "nsNSSComponent.h"
10 #include "certt.h"
12 class nsUsageArrayHelper
13 {
14 public:
15 nsUsageArrayHelper(CERTCertificate *aCert);
17 nsresult GetUsagesArray(const char *suffix,
18 bool localOnly,
19 uint32_t outArraySize,
20 uint32_t *_verified,
21 uint32_t *_count,
22 char16_t **tmpUsages);
24 enum { max_returned_out_array_size = 12 };
26 private:
27 CERTCertificate *mCert;
28 nsresult m_rv;
29 CERTCertDBHandle *defaultcertdb;
30 nsCOMPtr<nsINSSComponent> nssComponent;
32 uint32_t check(uint32_t previousCheckResult,
33 const char *suffix,
34 mozilla::psm::CertVerifier * certVerifier,
35 SECCertificateUsage aCertUsage,
36 PRTime time,
37 mozilla::psm::CertVerifier::Flags flags,
38 uint32_t &aCounter,
39 char16_t **outUsages);
41 void verifyFailed(uint32_t *_verified, int err);
42 };
44 #endif