michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef _NSUSAGEARRAYHELPER_H_ michael@0: #define _NSUSAGEARRAYHELPER_H_ michael@0: michael@0: #include "CertVerifier.h" michael@0: #include "nsNSSComponent.h" michael@0: #include "certt.h" michael@0: michael@0: class nsUsageArrayHelper michael@0: { michael@0: public: michael@0: nsUsageArrayHelper(CERTCertificate *aCert); michael@0: michael@0: nsresult GetUsagesArray(const char *suffix, michael@0: bool localOnly, michael@0: uint32_t outArraySize, michael@0: uint32_t *_verified, michael@0: uint32_t *_count, michael@0: char16_t **tmpUsages); michael@0: michael@0: enum { max_returned_out_array_size = 12 }; michael@0: michael@0: private: michael@0: CERTCertificate *mCert; michael@0: nsresult m_rv; michael@0: CERTCertDBHandle *defaultcertdb; michael@0: nsCOMPtr nssComponent; michael@0: michael@0: uint32_t check(uint32_t previousCheckResult, michael@0: const char *suffix, michael@0: mozilla::psm::CertVerifier * certVerifier, michael@0: SECCertificateUsage aCertUsage, michael@0: PRTime time, michael@0: mozilla::psm::CertVerifier::Flags flags, michael@0: uint32_t &aCounter, michael@0: char16_t **outUsages); michael@0: michael@0: void verifyFailed(uint32_t *_verified, int err); michael@0: }; michael@0: michael@0: #endif