|
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/. */ |
|
4 |
|
5 #ifndef _NSUSAGEARRAYHELPER_H_ |
|
6 #define _NSUSAGEARRAYHELPER_H_ |
|
7 |
|
8 #include "CertVerifier.h" |
|
9 #include "nsNSSComponent.h" |
|
10 #include "certt.h" |
|
11 |
|
12 class nsUsageArrayHelper |
|
13 { |
|
14 public: |
|
15 nsUsageArrayHelper(CERTCertificate *aCert); |
|
16 |
|
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); |
|
23 |
|
24 enum { max_returned_out_array_size = 12 }; |
|
25 |
|
26 private: |
|
27 CERTCertificate *mCert; |
|
28 nsresult m_rv; |
|
29 CERTCertDBHandle *defaultcertdb; |
|
30 nsCOMPtr<nsINSSComponent> nssComponent; |
|
31 |
|
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); |
|
40 |
|
41 void verifyFailed(uint32_t *_verified, int err); |
|
42 }; |
|
43 |
|
44 #endif |