Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Attributes
nsCRLInfo Class Reference

#include <nsCRLInfo.h>

Inheritance diagram for nsCRLInfo:
Inheritance graph
[legend]
Collaboration diagram for nsCRLInfo:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSICRLINFO 
nsCRLInfo ()
 nsCRLInfo (CERTSignedCrl *)
virtual ~nsCRLInfo ()

Public Attributes

readonly attribute AString organization
 The issuing CA's organization.
readonly attribute AString organizationalUnit
 The issuing CA's organizational unit.
readonly attribute PRTime lastUpdate
 The time this CRL was created at.
readonly attribute PRTime nextUpdate
 The time the suggested next update for this CRL.
readonly attribute AString lastUpdateLocale
 lastUpdate formatted as a human readable string formatted according to the environment locale.
readonly attribute AString nextUpdateLocale
 nextUpdate formatted as a human readable string formatted according to the environment locale.
readonly attribute AString nameInDb
 The key identifying the CRL in the database.
readonly attribute AUTF8String lastFetchURL
 The URL this CRL was last fetched from.

Private Attributes

nsString mOrg
nsString mOrgUnit
nsString mLastUpdateLocale
nsString mNextUpdateLocale
PRTime mLastUpdate
PRTime mNextUpdate
nsString mNameInDb
nsCString mLastFetchURL
nsString mNextAutoUpdateDate

Detailed Description

Definition at line 55 of file nsCRLInfo.h.


Constructor & Destructor Documentation

Definition at line 64 of file nsCRLInfo.cpp.

{
  /* member initializers and constructor code */
}
nsCRLInfo::nsCRLInfo ( CERTSignedCrl *  signedCrl)

Definition at line 69 of file nsCRLInfo.cpp.

{
  nsNSSShutDownPreventionLock locker;
  CERTCrl *crl = &(signedCrl->crl);
  nsAutoString org;
  nsAutoString orgUnit;
  nsAutoString nameInDb;
  nsAutoString nextUpdateLocale;
  nsAutoString lastUpdateLocale;
  nsCAutoString lastFetchURL;
  PRTime lastUpdate = 0;
  PRTime nextUpdate = 0;
  SECStatus sec_rv;
  
  // Get the information we need here //
  char * o = CERT_GetOrgName(&(crl->name));
  if (o) {
    org = NS_ConvertASCIItoUCS2(o);
    PORT_Free(o);
  }

  char * ou = CERT_GetOrgUnitName(&(crl->name));
  if (ou) {
    orgUnit = NS_ConvertASCIItoUCS2(ou);
    //At present, the ou is being used as the unique key - but this
    //would change, one support for delta crls come in.
    nameInDb =  orgUnit;
    PORT_Free(ou);
  }
  
  nsCOMPtr<nsIDateTimeFormat> dateFormatter = do_CreateInstance(kDateTimeFormatCID);
  
  // Last Update time
  if (crl->lastUpdate.len) {
    sec_rv = DER_UTCTimeToTime(&lastUpdate, &(crl->lastUpdate));
    if (sec_rv == SECSuccess && dateFormatter) {
      dateFormatter->FormatPRTime(nsnull, kDateFormatShort, kTimeFormatNone,
                            lastUpdate, lastUpdateLocale);
    }
  }

  if (crl->nextUpdate.len) {
    // Next update time
    sec_rv = DER_UTCTimeToTime(&nextUpdate, &(crl->nextUpdate));
    if (sec_rv == SECSuccess && dateFormatter) {
      dateFormatter->FormatPRTime(nsnull, kDateFormatShort, kTimeFormatNone,
                            nextUpdate, nextUpdateLocale);
    }
  }

  char * url = signedCrl->url;
  if(url) {
    lastFetchURL =  url;
  }

  mOrg.Assign(org.get());
  mOrgUnit.Assign(orgUnit.get());
  mLastUpdateLocale.Assign(lastUpdateLocale.get());
  mNextUpdateLocale.Assign(nextUpdateLocale.get());
  mLastUpdate = lastUpdate;
  mNextUpdate = nextUpdate;
  mNameInDb.Assign(nameInDb.get());
  mLastFetchURL = lastFetchURL;
}

Here is the call graph for this function:

nsCRLInfo::~nsCRLInfo ( ) [virtual]

Definition at line 134 of file nsCRLInfo.cpp.

{
  /* destructor code */
}

Member Data Documentation

readonly attribute AUTF8String nsICRLInfo::lastFetchURL [inherited]

The URL this CRL was last fetched from.

Definition at line 91 of file nsICRLInfo.idl.

readonly attribute PRTime nsICRLInfo::lastUpdate [inherited]

The time this CRL was created at.

Definition at line 64 of file nsICRLInfo.idl.

readonly attribute AString nsICRLInfo::lastUpdateLocale [inherited]

lastUpdate formatted as a human readable string formatted according to the environment locale.

Definition at line 75 of file nsICRLInfo.idl.

Definition at line 73 of file nsCRLInfo.h.

Definition at line 70 of file nsCRLInfo.h.

Definition at line 68 of file nsCRLInfo.h.

Definition at line 72 of file nsCRLInfo.h.

Definition at line 74 of file nsCRLInfo.h.

Definition at line 71 of file nsCRLInfo.h.

Definition at line 69 of file nsCRLInfo.h.

Definition at line 66 of file nsCRLInfo.h.

Definition at line 67 of file nsCRLInfo.h.

readonly attribute AString nsICRLInfo::nameInDb [inherited]

The key identifying the CRL in the database.

Definition at line 86 of file nsICRLInfo.idl.

readonly attribute PRTime nsICRLInfo::nextUpdate [inherited]

The time the suggested next update for this CRL.

Definition at line 69 of file nsICRLInfo.idl.

readonly attribute AString nsICRLInfo::nextUpdateLocale [inherited]

nextUpdate formatted as a human readable string formatted according to the environment locale.

Definition at line 81 of file nsICRLInfo.idl.

readonly attribute AString nsICRLInfo::organization [inherited]

The issuing CA's organization.

Definition at line 54 of file nsICRLInfo.idl.

readonly attribute AString nsICRLInfo::organizationalUnit [inherited]

The issuing CA's organizational unit.

Definition at line 59 of file nsICRLInfo.idl.


The documentation for this class was generated from the following files: