int cms_set1_SignerIdentifier(CMS_SignerIdentifier *sid, X509 *cert, int type)
	{
	switch(type)
		{
		case CMS_SIGNERINFO_ISSUER_SERIAL:
		if (!cms_set1_ias(&sid->d.issuerAndSerialNumber, cert))
			return 0;
		break;

		case CMS_SIGNERINFO_KEYIDENTIFIER:
		if (!cms_set1_keyid(&sid->d.subjectKeyIdentifier, cert))
			return 0;
		break;

		default:
		CMSerr(CMS_F_CMS_SET1_SIGNERIDENTIFIER, CMS_R_UNKNOWN_ID);
		return 0;
		}

	sid->type = type;

	return 1;
	}