rv = CERT_FindSubjectKeyIDExten(cert, &tmpitem);
rv = CERT_FindSubjectKeyIDExtension(cert, &tmpitem);
cert_GetKeyID(CERTCertificate *cert){    SECItem tmpitem;    SECStatus rv;    SECKEYPublicKey *key;        cert->subjectKeyID.len = 0;    /* see of the cert has a key identifier extension */    rv = CERT_FindSubjectKeyIDExten(cert, &tmpitem);    if ( rv == SECSuccess ) {	cert->subjectKeyID.data = (unsigned char*) PORT_ArenaAlloc(cert->arena, tmpitem.len);	if ( cert->subjectKeyID.data != NULL ) {	    PORT_Memcpy(cert->subjectKeyID.data, tmpitem.data, tmpitem.len);	    cert->subjectKeyID.len = tmpitem.len;	    cert->keyIDGenerated = PR_FALSE;	}		PORT_Free(tmpitem.data);    }        /* if the cert doesn't have a key identifier extension and the cert is     * a V1 fortezza certificate, use the cert's 8 byte KMID as the     * key identifier.  */    key = CERT_KMIDPublicKey(cert);    if (key != NULL) {		if (key->keyType == fortezzaKey) {	    cert->subjectKeyID.data = (unsigned char *)PORT_ArenaAlloc(cert->arena, 8);	    if ( cert->subjectKeyID.data != NULL ) {		PORT_Memcpy(cert->subjectKeyID.data, key->u.fortezza.KMID, 8);		cert->subjectKeyID.len = 8;		cert->keyIDGenerated = PR_FALSE;	    }	}			SECKEY_DestroyPublicKey(key);    }    /* if the cert doesn't have a key identifier extension, then generate one*/    if ( cert->subjectKeyID.len == 0 ) {	/*	 * pkix says that if the subjectKeyID is not present, then we should	 * use the SHA-1 hash of the DER-encoded publicKeyInfo from the cert	 */	cert->subjectKeyID.data = (unsigned char *)PORT_ArenaAlloc(cert->arena, SHA1_LENGTH);	if ( cert->subjectKeyID.data != NULL ) {	    rv = PK11_HashBuf(SEC_OID_SHA1,cert->subjectKeyID.data,			      cert->derPublicKey.data,			      cert->derPublicKey.len);	    if ( rv == SECSuccess ) {		cert->subjectKeyID.len = SHA1_LENGTH;	    }	}    }    if ( cert->subjectKeyID.len == 0 ) {	return(SECFailure);    }    return(SECSuccess);}