Line data Source code
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 nsNSSCertValidity_h
6 : #define nsNSSCertValidity_h
7 :
8 : #include "DateTimeFormat.h"
9 : #include "ScopedNSSTypes.h"
10 : #include "nsIX509CertValidity.h"
11 : #include "nsNSSShutDown.h"
12 :
13 : class nsX509CertValidity : public nsIX509CertValidity
14 : , public nsNSSShutDownObject
15 : {
16 : public:
17 : NS_DECL_THREADSAFE_ISUPPORTS
18 : NS_DECL_NSIX509CERTVALIDITY
19 :
20 : explicit nsX509CertValidity(const mozilla::UniqueCERTCertificate& cert);
21 :
22 : protected:
23 : virtual ~nsX509CertValidity();
24 :
25 : // Nothing to release.
26 0 : virtual void virtualDestroyNSSReference() override {}
27 :
28 : private:
29 : nsresult FormatTime(const PRTime& aTime,
30 : PRTimeParamFn aParamFn,
31 : const nsTimeFormatSelector aTimeFormatSelector,
32 : nsAString& aFormattedTimeDate);
33 :
34 : PRTime mNotBefore;
35 : PRTime mNotAfter;
36 : bool mTimesInitialized;
37 :
38 : nsX509CertValidity(const nsX509CertValidity& x) = delete;
39 : nsX509CertValidity& operator=(const nsX509CertValidity& x) = delete;
40 : };
41 :
42 : #endif // nsNSSCertValidity_h
|