gecko-dev/security/manager/ssl/nsNSSCertValidity.h
Nathan Froyd ae4c78cdd2 Bug 1253010 - part 1 - refactor nsX509CertValidity time formatting; r=keeler
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.
2015-12-05 10:26:19 -05:00

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