} if (emailOpt) { NSS_CK_SET_ATTRIBUTE_NULL(attr, CKA_NETSCAPE_EMAIL);
nssCryptokiCertificate_GetAttributes(  nssCryptokiObject *certObject,  nssSession *sessionOpt,  NSSArena *arenaOpt,  NSSCertificateType *certTypeOpt,  NSSItem *idOpt,  NSSDER *encodingOpt,  NSSDER *issuerOpt,  NSSDER *serialOpt,  NSSDER *subjectOpt,  NSSASCII7 **emailOpt){    PRStatus status;    PRUint32 i;    nssSession *session;    NSSSlot *slot;    CK_ULONG template_size;    CK_ATTRIBUTE_PTR attr;    CK_ATTRIBUTE cert_template[7];    /* Set up a template of all options chosen by caller */    NSS_CK_TEMPLATE_START(cert_template, attr, template_size);    if (certTypeOpt) {	NSS_CK_SET_ATTRIBUTE_NULL(attr, CKA_CERTIFICATE_TYPE);    }    if (idOpt) {	NSS_CK_SET_ATTRIBUTE_NULL(attr, CKA_ID);    }    if (encodingOpt) {	NSS_CK_SET_ATTRIBUTE_NULL(attr, CKA_VALUE);    }    if (issuerOpt) {	NSS_CK_SET_ATTRIBUTE_NULL(attr, CKA_ISSUER);    }    if (serialOpt) {	NSS_CK_SET_ATTRIBUTE_NULL(attr, CKA_SERIAL_NUMBER);    }    if (subjectOpt) {	NSS_CK_SET_ATTRIBUTE_NULL(attr, CKA_SUBJECT);    }    if (emailOpt) {	NSS_CK_SET_ATTRIBUTE_NULL(attr, CKA_NETSCAPE_EMAIL);    }    NSS_CK_TEMPLATE_FINISH(cert_template, attr, template_size);    if (template_size == 0) {	/* caller didn't want anything */	return PR_SUCCESS;    }    status = nssToken_GetCachedObjectAttributes(certObject->token, arenaOpt,                                                certObject, CKO_CERTIFICATE,                                                cert_template, template_size);    if (status != PR_SUCCESS) {	session = sessionOpt ? 	          sessionOpt : 	          nssToken_GetDefaultSession(certObject->token);	slot = nssToken_GetSlot(certObject->token);	status = nssCKObject_GetAttributes(certObject->handle, 	                                   cert_template, template_size,	                                   arenaOpt, session, slot);	nssSlot_Destroy(slot);	if (status != PR_SUCCESS) {	    return status;	}    }    i=0;    if (certTypeOpt) {	*certTypeOpt = nss_cert_type_from_ck_attrib(&cert_template[i]); i++;    }    if (idOpt) {	NSS_CK_ATTRIBUTE_TO_ITEM(&cert_template[i], idOpt); i++;    }    if (encodingOpt) {	NSS_CK_ATTRIBUTE_TO_ITEM(&cert_template[i], encodingOpt); i++;    }    if (issuerOpt) {	NSS_CK_ATTRIBUTE_TO_ITEM(&cert_template[i], issuerOpt); i++;    }    if (serialOpt) {	NSS_CK_ATTRIBUTE_TO_ITEM(&cert_template[i], serialOpt); i++;    }    if (subjectOpt) {	NSS_CK_ATTRIBUTE_TO_ITEM(&cert_template[i], subjectOpt); i++;    }    if (emailOpt) {	NSS_CK_ATTRIBUTE_TO_UTF8(&cert_template[i], *emailOpt); i++;    }    return PR_SUCCESS;}