signalg = SEC_OID_ANSIX962_ECDSA_SIGNATURE_WITH_SHA1_DIGEST;
signalg = SEC_OID_ANSIX962_EC_PUBLIC_KEY;
SGN_NewContext(SECOidTag alg, SECKEYPrivateKey *key){    SGNContext *cx;    SECOidTag hashalg, signalg;    KeyType keyType;    /* OK, map a PKCS #7 hash and encrypt algorithm into     * a standard hashing algorithm. Why did we pass in the whole     * PKCS #7 algTag if we were just going to change here you might     * ask. Well the answer is for some cards we may have to do the     * hashing on card. It may not support CKM_RSA_PKCS sign algorithm,     * it may just support CKM_RSA_PKCS_WITH_SHA1 and/or CKM_RSA_PKCS_WITH_MD5.     */    switch (alg) {      /* We probably shouldn't be generating MD2 signatures either */      case SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION:	hashalg = SEC_OID_MD2;	signalg = SEC_OID_PKCS1_RSA_ENCRYPTION;	keyType = rsaKey;	break;      case SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION:        hashalg = SEC_OID_MD5;	signalg = SEC_OID_PKCS1_RSA_ENCRYPTION;	keyType = rsaKey;	break;      case SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION:      case SEC_OID_ISO_SHA_WITH_RSA_SIGNATURE:	hashalg = SEC_OID_SHA1;	signalg = SEC_OID_PKCS1_RSA_ENCRYPTION;	keyType = rsaKey;	break;      case SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION:	hashalg = SEC_OID_SHA256;	signalg = SEC_OID_PKCS1_RSA_ENCRYPTION;	keyType = rsaKey;	break;      case SEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION:	hashalg = SEC_OID_SHA384;	signalg = SEC_OID_PKCS1_RSA_ENCRYPTION;	keyType = rsaKey;	break;      case SEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION:	hashalg = SEC_OID_SHA512;	signalg = SEC_OID_PKCS1_RSA_ENCRYPTION;	keyType = rsaKey;	break;      /* what about normal DSA? */      case SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST:      case SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST:	hashalg = SEC_OID_SHA1;	signalg = SEC_OID_ANSIX9_DSA_SIGNATURE;	keyType = dsaKey;	break;      case SEC_OID_MISSI_DSS:      case SEC_OID_MISSI_KEA_DSS:      case SEC_OID_MISSI_KEA_DSS_OLD:      case SEC_OID_MISSI_DSS_OLD:	hashalg = SEC_OID_SHA1;	signalg = SEC_OID_MISSI_DSS; /* XXX Is there a better algid? */	keyType = fortezzaKey;	break;#ifdef NSS_ENABLE_ECC      case SEC_OID_ANSIX962_ECDSA_SIGNATURE_WITH_SHA1_DIGEST:	hashalg = SEC_OID_SHA1;	signalg = SEC_OID_ANSIX962_ECDSA_SIGNATURE_WITH_SHA1_DIGEST;	keyType = ecKey;	break;#endif /* NSS_ENABLE_ECC */      /* we don't implement MD4 hashes.        * we *CERTAINLY* don't want to sign one! */      case SEC_OID_PKCS1_MD4_WITH_RSA_ENCRYPTION:      default:	PORT_SetError(SEC_ERROR_INVALID_ARGS);	return 0;    }    /* verify our key type */    if (key->keyType != keyType &&	!((key->keyType == dsaKey) && (keyType == fortezzaKey)) &&	!((key->keyType == fortezzaKey) && (keyType == dsaKey)) ) {	PORT_SetError(SEC_ERROR_INVALID_ALGORITHM);	return 0;    }    cx = (SGNContext*) PORT_ZAlloc(sizeof(SGNContext));    if (cx) {	cx->hashalg = hashalg;	cx->signalg = signalg;	cx->key = key;    }    return cx;}