data.len = 4; data.data = keyUsage; keyUsage[0] = 0x03; keyUsage[1] = 0x02; keyUsage[2] = 0x07; keyUsage[3] = KU_DIGITAL_SIGNATURE; extension = CRMF_CreateCertExtension(SEC_OID_X509_KEY_USAGE,prFalse, &data); extInfo = PORT_ZNew(CRMFCertExtCreationInfo); extInfo->numExtensions = 1; extInfo->extensions = PORT_ZNewArray(CRMFCertExtension*, 1); extInfo->extensions[0] = extension;
CRMFCertExtension *extension = CRMF_CreateCertExtension(SEC_OID_X509_KEY_USAGE, PR_FALSE, &data); CRMFCertExtCreationInfo *extInfo = PORT_ZNew(CRMFCertExtCreationInfo);  if (extension && extInfo) { extInfo->numExtensions = 1; extInfo->extensions    = PORT_ZNewArray(CRMFCertExtension*, 1); extInfo->extensions[0] = extension; }
GetExtensions(void){    CRMFCertExtCreationInfo *extInfo;    CRMFCertExtension *currExt;    CRMFCertExtension *extension;    SECItem data;    PRBool prFalse = PR_FALSE;    unsigned char keyUsage[4];    data.len = 4;    data.data = keyUsage;    keyUsage[0] = 0x03;    keyUsage[1] = 0x02;    keyUsage[2] = 0x07;    keyUsage[3] = KU_DIGITAL_SIGNATURE;    extension = CRMF_CreateCertExtension(SEC_OID_X509_KEY_USAGE,prFalse,					 &data);    extInfo = PORT_ZNew(CRMFCertExtCreationInfo);    extInfo->numExtensions = 1;    extInfo->extensions = PORT_ZNewArray(CRMFCertExtension*, 1);    extInfo->extensions[0] = extension;    return extInfo;}