mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 19:25:43 +00:00
ae4c78cdd2
nsX509CertValidity has several copy-pasted routines that differ only slightly in the parameters they use for formatting times. Let's have a single place to do the formatting and pass in the appropriate parameters.
37 lines
923 B
C++
37 lines
923 B
C++
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef _NSX509CERTVALIDITY_H_
|
|
#define _NSX509CERTVALIDITY_H_
|
|
|
|
#include "nsIDateTimeFormat.h"
|
|
#include "nsIX509CertValidity.h"
|
|
|
|
#include "certt.h"
|
|
|
|
class nsX509CertValidity : public nsIX509CertValidity
|
|
{
|
|
public:
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
|
NS_DECL_NSIX509CERTVALIDITY
|
|
|
|
nsX509CertValidity();
|
|
explicit nsX509CertValidity(CERTCertificate *cert);
|
|
|
|
protected:
|
|
virtual ~nsX509CertValidity();
|
|
/* additional members */
|
|
|
|
private:
|
|
nsresult FormatTime(const PRTime& aTime,
|
|
PRTimeParamFn aParamFn,
|
|
const nsTimeFormatSelector aTimeFormatSelector,
|
|
nsAString& aFormattedTimeDate);
|
|
|
|
PRTime mNotBefore, mNotAfter;
|
|
bool mTimesInitialized;
|
|
};
|
|
|
|
#endif
|