rv = SEC_ASN1DecodeItem(arena, pubk,
rv = SEC_QuickDERDecodeItem(arena, pubk,
nsslowcert_ExtractPublicKey(NSSLOWCERTCertificate *cert){    NSSLOWCERTSubjectPublicKeyInfo spki;    NSSLOWKEYPublicKey *pubk;    SECItem os;    SECStatus rv;    PRArenaPool *arena;    SECOidTag tag;    arena = PORT_NewArena (DER_DEFAULT_CHUNKSIZE);    if (arena == NULL)        return NULL;    pubk = (NSSLOWKEYPublicKey *) 		PORT_ArenaZAlloc(arena, sizeof(NSSLOWKEYPublicKey));    if (pubk == NULL) {        PORT_FreeArena (arena, PR_FALSE);        return NULL;    }    pubk->arena = arena;    PORT_Memset(&spki,0,sizeof(spki));    /* we haven't bothered decoding the spki struct yet, do it now */    rv = SEC_ASN1DecodeItem(arena, &spki, 		nsslowcert_SubjectPublicKeyInfoTemplate, &cert->derSubjKeyInfo);    if (rv != SECSuccess) { 	PORT_FreeArena (arena, PR_FALSE); 	return NULL;    }    /* Convert bit string length from bits to bytes */    os = spki.subjectPublicKey;    DER_ConvertBitString (&os);    tag = SECOID_GetAlgorithmTag(&spki.algorithm);    switch ( tag ) {      case SEC_OID_X500_RSA_ENCRYPTION:      case SEC_OID_PKCS1_RSA_ENCRYPTION:        pubk->keyType = NSSLOWKEYRSAKey;        prepare_low_rsa_pub_key_for_asn1(pubk);        rv = SEC_ASN1DecodeItem(arena, pubk, 				nsslowcert_RSAPublicKeyTemplate, &os);        if (rv == SECSuccess)            return pubk;        break;      case SEC_OID_ANSIX9_DSA_SIGNATURE:        pubk->keyType = NSSLOWKEYDSAKey;        prepare_low_dsa_pub_key_for_asn1(pubk);        rv = SEC_ASN1DecodeItem(arena, pubk,				 nsslowcert_DSAPublicKeyTemplate, &os);        if (rv == SECSuccess) return pubk;        break;      case SEC_OID_X942_DIFFIE_HELMAN_KEY:        pubk->keyType = NSSLOWKEYDHKey;        prepare_low_dh_pub_key_for_asn1(pubk);        rv = SEC_ASN1DecodeItem(arena, pubk,				 nsslowcert_DHPublicKeyTemplate, &os);        if (rv == SECSuccess) return pubk;        break;      default:        rv = SECFailure;        break;    }    nsslowkey_DestroyPublicKey (pubk);    return NULL;}