cert->emailAddr = CERT_GetCertificateEmailAddress(cert);
cert->emailAddr = cert_GetCertificateEmailAddresses(cert);
CERT_DecodeDERCertificate(SECItem *derSignedCert, PRBool copyDER,			 char *nickname){    CERTCertificate *cert;    PRArenaPool *arena;    void *data;    int rv;    int len;    char *tmpname;        /* make a new arena */    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);        if ( !arena ) {	return 0;    }    /* allocate the certificate structure */    cert = (CERTCertificate *)PORT_ArenaZAlloc(arena, sizeof(CERTCertificate));        if ( !cert ) {	goto loser;    }        cert->arena = arena;        if ( copyDER ) {	/* copy the DER data for the cert into this arena */	data = (void *)PORT_ArenaAlloc(arena, derSignedCert->len);	if ( !data ) {	    goto loser;	}	cert->derCert.data = (unsigned char *)data;	cert->derCert.len = derSignedCert->len;	PORT_Memcpy(data, derSignedCert->data, derSignedCert->len);    } else {	/* point to passed in DER data */	cert->derCert = *derSignedCert;    }    /* decode the certificate info */    rv = SEC_QuickDERDecodeItem(arena, cert, SEC_SignedCertificateTemplate,		    &cert->derCert);    if ( rv ) {	goto loser;    }    if (cert_HasUnknownCriticalExten (cert->extensions) == PR_TRUE) {	PORT_SetError(SEC_ERROR_UNKNOWN_CRITICAL_EXTENSION);	goto loser;    }    /* generate and save the database key for the cert */    rv = CERT_KeyFromIssuerAndSN(arena, &cert->derIssuer, &cert->serialNumber,			&cert->certKey);    if ( rv ) {	goto loser;    }    /* set the nickname */    if ( nickname == NULL ) {	cert->nickname = NULL;    } else {	/* copy and install the nickname */	len = PORT_Strlen(nickname) + 1;	cert->nickname = (char*)PORT_ArenaAlloc(arena, len);	if ( cert->nickname == NULL ) {	    goto loser;	}	PORT_Memcpy(cert->nickname, nickname, len);    }    /* set the email address */    cert->emailAddr = CERT_GetCertificateEmailAddress(cert);        /* initialize the subjectKeyID */    rv = cert_GetKeyID(cert);    if ( rv != SECSuccess ) {	goto loser;    }    /* initialize keyUsage */    rv = GetKeyUsage(cert);    if ( rv != SECSuccess ) {	goto loser;    }    /* initialize the certType */    rv = CERT_GetCertType(cert);    if ( rv != SECSuccess ) {	goto loser;    }    /* determine if this is a root cert */    cert->isRoot = cert_IsRootCert(cert);    tmpname = CERT_NameToAscii(&cert->subject);    if ( tmpname != NULL ) {	cert->subjectName = PORT_ArenaStrdup(cert->arena, tmpname);	PORT_Free(tmpname);    }        tmpname = CERT_NameToAscii(&cert->issuer);    if ( tmpname != NULL ) {	cert->issuerName = PORT_ArenaStrdup(cert->arena, tmpname);	PORT_Free(tmpname);    }        cert->referenceCount = 1;    cert->slot = NULL;    cert->pkcs11ID = CK_INVALID_HANDLE;    cert->dbnickname = NULL;        return(cert);    loser:    if ( arena ) {	PORT_FreeArena(arena, PR_FALSE);    }        return(0);}