Inheritance: DerBitString
		private IssuingDistributionPoint(Asn1Sequence seq)
		{
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			this.seq = seq;
			for (int i = 0; i != seq.Count; i++)
			{
				Asn1TaggedObject instance = Asn1TaggedObject.GetInstance(seq[i]);
				switch (instance.TagNo)
				{
				case 0:
					_distributionPoint = DistributionPointName.GetInstance(instance, explicitly: true);
					break;
				case 1:
					_onlyContainsUserCerts = DerBoolean.GetInstance(instance, isExplicit: false).IsTrue;
					break;
				case 2:
					_onlyContainsCACerts = DerBoolean.GetInstance(instance, isExplicit: false).IsTrue;
					break;
				case 3:
					_onlySomeReasons = new ReasonFlags(DerBitString.GetInstance(instance, isExplicit: false));
					break;
				case 4:
					_indirectCRL = DerBoolean.GetInstance(instance, isExplicit: false).IsTrue;
					break;
				case 5:
					_onlyContainsAttributeCerts = DerBoolean.GetInstance(instance, isExplicit: false).IsTrue;
					break;
				default:
					throw new ArgumentException("unknown tag in IssuingDistributionPoint");
				}
			}
		}
		public IssuingDistributionPoint(DistributionPointName distributionPoint, bool onlyContainsUserCerts, bool onlyContainsCACerts, ReasonFlags onlySomeReasons, bool indirectCRL, bool onlyContainsAttributeCerts)
		{
			_distributionPoint = distributionPoint;
			_indirectCRL = indirectCRL;
			_onlyContainsAttributeCerts = onlyContainsAttributeCerts;
			_onlyContainsCACerts = onlyContainsCACerts;
			_onlyContainsUserCerts = onlyContainsUserCerts;
			_onlySomeReasons = onlySomeReasons;
			Asn1EncodableVector asn1EncodableVector = new Asn1EncodableVector();
			if (distributionPoint != null)
			{
				asn1EncodableVector.Add(new DerTaggedObject(explicitly: true, 0, distributionPoint));
			}
			if (onlyContainsUserCerts)
			{
				asn1EncodableVector.Add(new DerTaggedObject(explicitly: false, 1, DerBoolean.True));
			}
			if (onlyContainsCACerts)
			{
				asn1EncodableVector.Add(new DerTaggedObject(explicitly: false, 2, DerBoolean.True));
			}
			if (onlySomeReasons != null)
			{
				asn1EncodableVector.Add(new DerTaggedObject(explicitly: false, 3, onlySomeReasons));
			}
			if (indirectCRL)
			{
				asn1EncodableVector.Add(new DerTaggedObject(explicitly: false, 4, DerBoolean.True));
			}
			if (onlyContainsAttributeCerts)
			{
				asn1EncodableVector.Add(new DerTaggedObject(explicitly: false, 5, DerBoolean.True));
			}
			seq = new DerSequence(asn1EncodableVector);
		}
 public DistributionPoint(
     DistributionPointName	distributionPointName,
     ReasonFlags				reasons,
     GeneralNames			crlIssuer)
 {
     this.distributionPoint = distributionPointName;
     this.reasons = reasons;
     this.cRLIssuer = crlIssuer;
 }
Exemple #4
0
 public DistributionPoint(
     DistributionPointName distributionPointName,
     ReasonFlags reasons,
     GeneralNames crlIssuer)
 {
     this.distributionPoint = distributionPointName;
     this.reasons           = reasons;
     this.cRLIssuer         = crlIssuer;
 }
Exemple #5
0
        /**
         * Constructor from given details.
         *
         * @param distributionPoint
         *            May contain an URI as pointer to most current CRL.
         * @param onlyContainsUserCerts Covers revocation information for end certificates.
         * @param onlyContainsCACerts Covers revocation information for CA certificates.
         *
         * @param onlySomeReasons
         *            Which revocation reasons does this point cover.
         * @param indirectCRL
         *            If <code>true</code> then the CRL contains revocation
         *            information about certificates ssued by other CAs.
         * @param onlyContainsAttributeCerts Covers revocation information for attribute certificates.
         */
        public IssuingDistributionPoint(
            DistributionPointName distributionPoint,
            bool onlyContainsUserCerts,
            bool onlyContainsCACerts,
            ReasonFlags onlySomeReasons,
            bool indirectCRL,
            bool onlyContainsAttributeCerts)
        {
            this._distributionPoint          = distributionPoint;
            this._indirectCRL                = indirectCRL;
            this._onlyContainsAttributeCerts = onlyContainsAttributeCerts;
            this._onlyContainsCACerts        = onlyContainsCACerts;
            this._onlyContainsUserCerts      = onlyContainsUserCerts;
            this._onlySomeReasons            = onlySomeReasons;

            Asn1EncodableVector vec = new Asn1EncodableVector();

            if (distributionPoint != null)
            {                   // CHOICE item so explicitly tagged
                vec.Add(new DerTaggedObject(true, 0, distributionPoint));
            }
            if (onlyContainsUserCerts)
            {
                vec.Add(new DerTaggedObject(false, 1, DerBoolean.True));
            }
            if (onlyContainsCACerts)
            {
                vec.Add(new DerTaggedObject(false, 2, DerBoolean.True));
            }
            if (onlySomeReasons != null)
            {
                vec.Add(new DerTaggedObject(false, 3, onlySomeReasons));
            }
            if (indirectCRL)
            {
                vec.Add(new DerTaggedObject(false, 4, DerBoolean.True));
            }
            if (onlyContainsAttributeCerts)
            {
                vec.Add(new DerTaggedObject(false, 5, DerBoolean.True));
            }

            seq = new DerSequence(vec);
        }
		/**
		 * Constructor from given details.
		 * 
		 * @param distributionPoint
		 *            May contain an URI as pointer to most current CRL.
		 * @param onlyContainsUserCerts Covers revocation information for end certificates.
		 * @param onlyContainsCACerts Covers revocation information for CA certificates.
		 * 
		 * @param onlySomeReasons
		 *            Which revocation reasons does this point cover.
		 * @param indirectCRL
		 *            If <code>true</code> then the CRL contains revocation
		 *            information about certificates ssued by other CAs.
		 * @param onlyContainsAttributeCerts Covers revocation information for attribute certificates.
		 */
		public IssuingDistributionPoint(
			DistributionPointName	distributionPoint,
			bool					onlyContainsUserCerts,
			bool					onlyContainsCACerts,
			ReasonFlags				onlySomeReasons,
			bool					indirectCRL,
			bool					onlyContainsAttributeCerts)
		{
			this._distributionPoint = distributionPoint;
			this._indirectCRL = indirectCRL;
			this._onlyContainsAttributeCerts = onlyContainsAttributeCerts;
			this._onlyContainsCACerts = onlyContainsCACerts;
			this._onlyContainsUserCerts = onlyContainsUserCerts;
			this._onlySomeReasons = onlySomeReasons;

			Asn1EncodableVector vec = new Asn1EncodableVector();
			if (distributionPoint != null)
			{	// CHOICE item so explicitly tagged
				vec.Add(new DerTaggedObject(true, 0, distributionPoint));
			}
			if (onlyContainsUserCerts)
			{
				vec.Add(new DerTaggedObject(false, 1, DerBoolean.True));
			}
			if (onlyContainsCACerts)
			{
				vec.Add(new DerTaggedObject(false, 2, DerBoolean.True));
			}
			if (onlySomeReasons != null)
			{
				vec.Add(new DerTaggedObject(false, 3, onlySomeReasons));
			}
			if (indirectCRL)
			{
				vec.Add(new DerTaggedObject(false, 4, DerBoolean.True));
			}
			if (onlyContainsAttributeCerts)
			{
				vec.Add(new DerTaggedObject(false, 5, DerBoolean.True));
			}

			seq = new DerSequence(vec);
		}
		private DistributionPoint(Asn1Sequence seq)
		{
			for (int i = 0; i != seq.Count; i++)
			{
				Asn1TaggedObject instance = Asn1TaggedObject.GetInstance(seq[i]);
				switch (instance.TagNo)
				{
				case 0:
					distributionPoint = DistributionPointName.GetInstance(instance, explicitly: true);
					break;
				case 1:
					reasons = new ReasonFlags(DerBitString.GetInstance(instance, isExplicit: false));
					break;
				case 2:
					cRLIssuer = GeneralNames.GetInstance(instance, explicitly: false);
					break;
				}
			}
		}
        public IssuingDistributionPoint(DistributionPointName distributionPoint, bool onlyContainsUserCerts, bool onlyContainsCACerts, ReasonFlags onlySomeReasons, bool indirectCRL, bool onlyContainsAttributeCerts)
        {
            this._distributionPoint          = distributionPoint;
            this._indirectCRL                = indirectCRL;
            this._onlyContainsAttributeCerts = onlyContainsAttributeCerts;
            this._onlyContainsCACerts        = onlyContainsCACerts;
            this._onlyContainsUserCerts      = onlyContainsUserCerts;
            this._onlySomeReasons            = onlySomeReasons;
            Asn1EncodableVector v = new Asn1EncodableVector(Array.Empty <Asn1Encodable>());

            if (distributionPoint != null)
            {
                Asn1Encodable[] objs = new Asn1Encodable[] { new DerTaggedObject(true, 0, distributionPoint) };
                v.Add(objs);
            }
            if (onlyContainsUserCerts)
            {
                Asn1Encodable[] objs = new Asn1Encodable[] { new DerTaggedObject(false, 1, DerBoolean.True) };
                v.Add(objs);
            }
            if (onlyContainsCACerts)
            {
                Asn1Encodable[] objs = new Asn1Encodable[] { new DerTaggedObject(false, 2, DerBoolean.True) };
                v.Add(objs);
            }
            if (onlySomeReasons != null)
            {
                Asn1Encodable[] objs = new Asn1Encodable[] { new DerTaggedObject(false, 3, onlySomeReasons) };
                v.Add(objs);
            }
            if (indirectCRL)
            {
                Asn1Encodable[] objs = new Asn1Encodable[] { new DerTaggedObject(false, 4, DerBoolean.True) };
                v.Add(objs);
            }
            if (onlyContainsAttributeCerts)
            {
                Asn1Encodable[] objs = new Asn1Encodable[] { new DerTaggedObject(false, 5, DerBoolean.True) };
                v.Add(objs);
            }
            this.seq = new DerSequence(v);
        }
Exemple #9
0
        /**
         * Constructor from Asn1Sequence
         */
        private IssuingDistributionPoint(
            Asn1Sequence seq)
        {
            this.seq = seq;

            for (int i = 0; i != seq.Count; i++)
            {
                Asn1TaggedObject o = Asn1TaggedObject.GetInstance(seq[i]);

                switch (o.TagNo)
                {
                case 0:
                    // CHOICE so explicit
                    _distributionPoint = DistributionPointName.GetInstance(o, true);
                    break;

                case 1:
                    _onlyContainsUserCerts = DerBoolean.GetInstance(o, false).IsTrue;
                    break;

                case 2:
                    _onlyContainsCACerts = DerBoolean.GetInstance(o, false).IsTrue;
                    break;

                case 3:
                    _onlySomeReasons = new ReasonFlags(ReasonFlags.GetInstance(o, false));
                    break;

                case 4:
                    _indirectCRL = DerBoolean.GetInstance(o, false).IsTrue;
                    break;

                case 5:
                    _onlyContainsAttributeCerts = DerBoolean.GetInstance(o, false).IsTrue;
                    break;

                default:
                    throw new ArgumentException("unknown tag in IssuingDistributionPoint");
                }
            }
        }
        private DistributionPoint(
            Asn1Sequence seq)
        {
            for (int i = 0; i != seq.Count; i++)
            {
                Asn1TaggedObject t = Asn1TaggedObject.GetInstance(seq[i]);

                switch (t.TagNo)
                {
                case 0:
                    distributionPoint = DistributionPointName.GetInstance(t, true);
                    break;
                case 1:
                    reasons = new ReasonFlags(DerBitString.GetInstance(t, false));
                    break;
                case 2:
                    cRLIssuer = GeneralNames.GetInstance(t, false);
                    break;
                }
            }
        }
Exemple #11
0
        private DistributionPoint(Asn1Sequence seq)
        {
            for (int num = 0; num != seq.Count; num++)
            {
                Asn1TaggedObject instance = Asn1TaggedObject.GetInstance(seq[num]);
                switch (instance.TagNo)
                {
                case 0:
                    this.distributionPoint = DistributionPointName.GetInstance(instance, true);
                    break;

                case 1:
                    this.reasons = new ReasonFlags(DerBitString.GetInstance(instance, false));
                    break;

                case 2:
                    this.cRLIssuer = GeneralNames.GetInstance(instance, false);
                    break;
                }
            }
        }
        private DistributionPoint(Asn1Sequence seq)
        {
            for (int i = 0; i != seq.Count; i++)
            {
                Asn1TaggedObject instance = Asn1TaggedObject.GetInstance(seq[i]);
                switch (instance.TagNo)
                {
                case 0:
                    this.distributionPoint = Org.BouncyCastle.Asn1.X509.DistributionPointName.GetInstance(instance, true);
                    break;

                case 1:
                    this.reasons = new ReasonFlags(DerBitString.GetInstance(instance, false));
                    break;

                case 2:
                    this.cRLIssuer = GeneralNames.GetInstance(instance, false);
                    break;
                }
            }
        }
		private void checkValues(
			IssuingDistributionPoint	point,
			DistributionPointName		distributionPoint,
			bool						onlyContainsUserCerts,
			bool						onlyContainsCACerts,
			ReasonFlags					onlySomeReasons,
			bool						indirectCRL,
			bool						onlyContainsAttributeCerts)
		{
			if (point.OnlyContainsUserCerts != onlyContainsUserCerts)
			{
				Fail("mismatch on onlyContainsUserCerts");
			}

			if (point.OnlyContainsCACerts != onlyContainsCACerts)
			{
				Fail("mismatch on onlyContainsCACerts");
			}

			if (point.IsIndirectCrl != indirectCRL)
			{
				Fail("mismatch on indirectCRL");
			}

			if (point.OnlyContainsAttributeCerts != onlyContainsAttributeCerts)
			{
				Fail("mismatch on onlyContainsAttributeCerts");
			}

			if (!isEquiv(onlySomeReasons, point.OnlySomeReasons))
			{
				Fail("mismatch on onlySomeReasons");
			}

			if (!isEquiv(distributionPoint, point.DistributionPoint))
			{
				Fail("mismatch on distributionPoint");
			}
		}
		public override void PerformTest()
		{
			DistributionPointName name = new DistributionPointName(
				new GeneralNames(new GeneralName(new X509Name("cn=test"))));
			ReasonFlags reasonFlags = new ReasonFlags(ReasonFlags.CACompromise);

			checkPoint(6, name, true, true, reasonFlags, true, true);

			checkPoint(2, name, false, false, reasonFlags, false, false);

			checkPoint(0, null, false, false, null, false, false);

			try
			{
				IssuingDistributionPoint.GetInstance(new object());

				Fail("GetInstance() failed to detect bad object.");
			}
			catch (ArgumentException)
			{
				// expected
			}
		}
Exemple #15
0
        private IssuingDistributionPoint(Asn1Sequence seq)
        {
            this.seq = seq;
            for (int num = 0; num != seq.Count; num++)
            {
                Asn1TaggedObject instance = Asn1TaggedObject.GetInstance(seq[num]);
                switch (instance.TagNo)
                {
                case 0:
                    this._distributionPoint = DistributionPointName.GetInstance(instance, true);
                    break;

                case 1:
                    this._onlyContainsUserCerts = DerBoolean.GetInstance(instance, false).IsTrue;
                    break;

                case 2:
                    this._onlyContainsCACerts = DerBoolean.GetInstance(instance, false).IsTrue;
                    break;

                case 3:
                    this._onlySomeReasons = new ReasonFlags(DerBitString.GetInstance(instance, false));
                    break;

                case 4:
                    this._indirectCRL = DerBoolean.GetInstance(instance, false).IsTrue;
                    break;

                case 5:
                    this._onlyContainsAttributeCerts = DerBoolean.GetInstance(instance, false).IsTrue;
                    break;

                default:
                    throw new ArgumentException("unknown tag in IssuingDistributionPoint");
                }
            }
        }
		private void checkPoint(
			int						size,
			DistributionPointName	distributionPoint,
			bool					onlyContainsUserCerts,
			bool					onlyContainsCACerts,
			ReasonFlags				onlySomeReasons,
			bool					indirectCRL,
			bool					onlyContainsAttributeCerts)
		{
			IssuingDistributionPoint point = new IssuingDistributionPoint(distributionPoint, onlyContainsUserCerts, onlyContainsCACerts, onlySomeReasons, indirectCRL, onlyContainsAttributeCerts);

			checkValues(point, distributionPoint, onlyContainsUserCerts, onlyContainsCACerts, onlySomeReasons, indirectCRL, onlyContainsAttributeCerts);

			Asn1Sequence seq = Asn1Sequence.GetInstance(Asn1Object.FromByteArray(point.GetEncoded()));

			if (seq.Count != size)
			{
				Fail("size mismatch");
			}

			point = IssuingDistributionPoint.GetInstance(seq);

			checkValues(point, distributionPoint, onlyContainsUserCerts, onlyContainsCACerts, onlySomeReasons, indirectCRL, onlyContainsAttributeCerts);
		}
 public DistributionPoint(Org.BouncyCastle.Asn1.X509.DistributionPointName distributionPointName, ReasonFlags reasons, GeneralNames crlIssuer)
 {
     this.distributionPoint = distributionPointName;
     this.reasons           = reasons;
     this.cRLIssuer         = crlIssuer;
 }
		/**
         * Constructor from Asn1Sequence
         */
        private IssuingDistributionPoint(
            Asn1Sequence seq)
        {
            this.seq = seq;

			for (int i = 0; i != seq.Count; i++)
            {
				Asn1TaggedObject o = Asn1TaggedObject.GetInstance(seq[i]);

				switch (o.TagNo)
                {
					case 0:
						// CHOICE so explicit
						_distributionPoint = DistributionPointName.GetInstance(o, true);
						break;
					case 1:
						_onlyContainsUserCerts = DerBoolean.GetInstance(o, false).IsTrue;
						break;
					case 2:
						_onlyContainsCACerts = DerBoolean.GetInstance(o, false).IsTrue;
						break;
					case 3:
						_onlySomeReasons = new ReasonFlags(ReasonFlags.GetInstance(o, false));
						break;
					case 4:
						_indirectCRL = DerBoolean.GetInstance(o, false).IsTrue;
						break;
					case 5:
						_onlyContainsAttributeCerts = DerBoolean.GetInstance(o, false).IsTrue;
						break;
					default:
						throw new ArgumentException("unknown tag in IssuingDistributionPoint");
                }
            }
        }