public void AddCrlEntry(DerInteger userCertificate, Time revocationDate, int reason,
                                DerGeneralizedTime invalidityDate)
        {
            IList extOids   = Platform.CreateArrayList();
            IList extValues = Platform.CreateArrayList();

            if (reason != 0)
            {
                CrlReason crlReason = new CrlReason(reason);

                try
                {
                    extOids.Add(X509Extensions.ReasonCode);
                    extValues.Add(new X509Extension(false, new DerOctetString(crlReason.GetEncoded())));
                }
                catch (IOException e)
                {
                    throw new ArgumentException("error encoding reason: " + e);
                }
            }

            if (invalidityDate != null)
            {
                try
                {
                    extOids.Add(X509Extensions.InvalidityDate);
                    extValues.Add(new X509Extension(false, new DerOctetString(invalidityDate.GetEncoded())));
                }
                catch (IOException e)
                {
                    throw new ArgumentException("error encoding invalidityDate: " + e);
                }
            }

            if (extOids.Count != 0)
            {
                AddCrlEntry(userCertificate, revocationDate, new X509Extensions(extOids, extValues));
            }
            else
            {
                AddCrlEntry(userCertificate, revocationDate, null);
            }
        }
		public void AddCrlEntry(DerInteger userCertificate, Time revocationDate, int reason,
			DerGeneralizedTime invalidityDate)
		{
            IList extOids = Platform.CreateArrayList();
            IList extValues = Platform.CreateArrayList();

			if (reason != 0)
			{
				CrlReason crlReason = new CrlReason(reason);

				try
				{
					extOids.Add(X509Extensions.ReasonCode);
					extValues.Add(new X509Extension(false, new DerOctetString(crlReason.GetEncoded())));
				}
				catch (IOException e)
				{
					throw new ArgumentException("error encoding reason: " + e);
				}
			}

			if (invalidityDate != null)
			{
				try
				{
					extOids.Add(X509Extensions.InvalidityDate);
					extValues.Add(new X509Extension(false, new DerOctetString(invalidityDate.GetEncoded())));
				}
				catch (IOException e)
				{
					throw new ArgumentException("error encoding invalidityDate: " + e);
				}
			}

			if (extOids.Count != 0)
			{
				AddCrlEntry(userCertificate, revocationDate, new X509Extensions(extOids, extValues));
			}
			else
			{
				AddCrlEntry(userCertificate, revocationDate, null);
			}
		}