Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsskea.c File Reference
#include "cert.h"
#include "ssl.h"
#include "secoid.h"

Go to the source code of this file.

Functions

SSLKEAType NSS_FindCertKEAType (CERTCertificate *cert)

Function Documentation

SSLKEAType NSS_FindCertKEAType ( CERTCertificate *  cert)

Definition at line 47 of file nsskea.c.

{
  SSLKEAType keaType = kt_null; 
  int tag;
  
  if (!cert) goto loser;
  
  tag = SECOID_GetAlgorithmTag(&(cert->subjectPublicKeyInfo.algorithm));
  
  switch (tag) {
  case SEC_OID_X500_RSA_ENCRYPTION:
  case SEC_OID_PKCS1_RSA_ENCRYPTION:
    keaType = kt_rsa;
    break;
  case SEC_OID_X942_DIFFIE_HELMAN_KEY:
    keaType = kt_dh;
    break;
#ifdef NSS_ENABLE_ECC
  case SEC_OID_ANSIX962_EC_PUBLIC_KEY:
    keaType = kt_ecdh;
    break;
#endif /* NSS_ENABLE_ECC */
  default:
    keaType = kt_null;
  }
  
 loser:
  
  return keaType;

}

Here is the caller graph for this function: