Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsNSSCertHelper.h File Reference
#include "nsNSSCertHeader.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

PRUint32 getCertType (CERTCertificate *cert)
CERTCertNicknames * getNSSCertNicknamesFromCertList (CERTCertList *certList)

Function Documentation

PRUint32 getCertType ( CERTCertificate *  cert)

Definition at line 2088 of file nsNSSCertHelper.cpp.

{
  nsNSSCertTrust trust(cert->trust);
  if (cert->nickname && trust.HasAnyUser())
    return nsIX509Cert::USER_CERT;
  if (trust.HasAnyCA())
    return nsIX509Cert::CA_CERT;
  if (trust.HasPeer(PR_TRUE, PR_FALSE, PR_FALSE))
    return nsIX509Cert::SERVER_CERT;
  if (trust.HasPeer(PR_FALSE, PR_TRUE, PR_FALSE) && cert->emailAddr)
    return nsIX509Cert::EMAIL_CERT;
  if (CERT_IsCACert(cert,NULL))
    return nsIX509Cert::CA_CERT;
  if (cert->emailAddr)
    return nsIX509Cert::EMAIL_CERT;
  return nsIX509Cert::SERVER_CERT;
}

Here is the call graph for this function:

Here is the caller graph for this function:

CERTCertNicknames* getNSSCertNicknamesFromCertList ( CERTCertList *  certList)

Definition at line 2107 of file nsNSSCertHelper.cpp.

{
  nsresult rv;

  nsCOMPtr<nsINSSComponent> nssComponent(do_GetService(kNSSComponentCID, &rv));
  if (NS_FAILED(rv))
    return nsnull;

  nsAutoString expiredString, notYetValidString;
  nsAutoString expiredStringLeadingSpace, notYetValidStringLeadingSpace;

  nssComponent->GetPIPNSSBundleString("NicknameExpired", expiredString);
  nssComponent->GetPIPNSSBundleString("NicknameNotYetValid", notYetValidString);

  expiredStringLeadingSpace.Append(NS_LITERAL_STRING(" "));
  expiredStringLeadingSpace.Append(expiredString);

  notYetValidStringLeadingSpace.Append(NS_LITERAL_STRING(" "));
  notYetValidStringLeadingSpace.Append(notYetValidString);

  NS_ConvertUCS2toUTF8 aUtf8ExpiredString(expiredStringLeadingSpace);
  NS_ConvertUCS2toUTF8 aUtf8NotYetValidString(notYetValidStringLeadingSpace);

  return CERT_NicknameStringsFromCertList(certList,
                                          NS_CONST_CAST(char*, aUtf8ExpiredString.get()),
                                          NS_CONST_CAST(char*, aUtf8NotYetValidString.get()));
  
}

Here is the call graph for this function:

Here is the caller graph for this function: