public Asn1Object toASN1Primitive()
 {
     Asn1EncodableVector dev = new Asn1EncodableVector();
     dev.Add(this.sigPolicyQualifierId);
     dev.Add(this.sigQualifier);
     return new DerSequence(dev);
 }
Beispiel #2
0
 public static Asn1Set CreateBerSetFromList(List<Asn1Encodable> derObjects)
 {
     Asn1EncodableVector v = new Asn1EncodableVector();
     foreach (Asn1Encodable d in derObjects)
     {
         v.Add(d);
     }
     return new BerSet(v);
 }
		/**
		 * create a sequence containing a vector of objects.
		 */
		public DerSequence(
			Asn1EncodableVector v)
			: base(v.Count)
		{
			foreach (Asn1Encodable ae in v)
			{
				AddObject(ae);
			}
		}
        /// <summary>
        /// Write myself to the given stream
        /// </summary>
        public void WriteTo(Stream stream, out string md5FingerPrint, out string sha1FingerPrint)
        {
            X509Certificate[] cert;
            AsymmetricKeyEntry privateKey;
            LoadPfx(out cert, out privateKey);

            var certsVector = new Asn1EncodableVector();
            md5FingerPrint = null;
            sha1FingerPrint = null;
            foreach (var c in cert)
            {
                var certStream = new MemoryStream(c.GetEncoded());
                var certStruct = X509CertificateStructure.GetInstance(new Asn1InputStream(certStream).ReadObject());
                certsVector.Add(certStruct);

                if (md5FingerPrint == null)
                {
                    var certData = certStream.ToArray();
                    md5FingerPrint = CreateFingerprint(new MD5Digest(), certData);
                }

                if (sha1FingerPrint == null)
                {
                    var certData = certStream.ToArray();
                    sha1FingerPrint = CreateFingerprint(new Sha1Digest(), certData);
                }
            }

            var encryptedSignature = GetSignature(signature, privateKey.Key);
            var signerInfo = new SignerInfo(
                new DerInteger(1),
                new IssuerAndSerialNumber(cert[0].IssuerDN, cert[0].SerialNumber),
                new AlgorithmIdentifier(Oids.SHA1, DerNull.Instance),
                null,
                new AlgorithmIdentifier(Oids.RSA, DerNull.Instance),
                new DerOctetString(encryptedSignature),
                null);

            var pkcs7 = new SignedData(
                new DerInteger(1),
                new DerSet(new AlgorithmIdentifier(Oids.SHA1, DerNull.Instance)),
                new ContentInfo(new DerObjectIdentifier(Oids.data), null),
                new DerSet(certsVector),
                null,
                new DerSet(signerInfo));

            //var signedData = new ContentInfo(new DERObjectIdentifier(Oids.signedData), pkcs7);

            var v = new Asn1EncodableVector();
            v.Add(new DerObjectIdentifier(Oids.signedData));
            v.Add(new DerTaggedObject(0, pkcs7));            
            var signedData = new DerSequence(v);

            // Save
            var data = signedData.GetEncoded();
            stream.Write(data, 0, data.Length);
        }
		public static Asn1EncodableVector FromEnumerable(
			IEnumerable e)
		{
			Asn1EncodableVector v = new Asn1EncodableVector();
			foreach (Asn1Encodable obj in e)
			{
				v.Add(obj);
			}
			return v;
		}
		/**
		 * Produce an object suitable for an Asn1OutputStream.
		 * <pre>
		 * ContentInfo ::= Sequence {
		 *          contentType ContentType,
		 *          content
		 *          [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
		 * </pre>
		 */
		public override Asn1Object ToAsn1Object()
		{
			Asn1EncodableVector v = new Asn1EncodableVector(contentType);

			if (content != null)
			{
				v.Add(new BerTaggedObject(0, content));
			}

			return new BerSequence(v);
		}
		/**
         * Produce an object suitable for an Asn1OutputStream.
         * <pre>
         * RevokedInfo ::= Sequence {
         *      revocationTime              GeneralizedTime,
         *      revocationReason    [0]     EXPLICIT CRLReason OPTIONAL }
         * </pre>
         */
        public override Asn1Object ToAsn1Object()
        {
			Asn1EncodableVector v = new Asn1EncodableVector(revocationTime);

			if (revocationReason != null)
            {
                v.Add(new DerTaggedObject(true, 0, revocationReason));
            }

			return new DerSequence(v);
        }
		/**
        * <pre>
        * CommitmentTypeIndication ::= SEQUENCE {
        *      commitmentTypeId   CommitmentTypeIdentifier,
        *      commitmentTypeQualifier   SEQUENCE SIZE (1..MAX) OF
        *              CommitmentTypeQualifier OPTIONAL }
        * </pre>
        */
        public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(commitmentTypeId);

			if (commitmentTypeQualifier != null)
            {
                v.Add(commitmentTypeQualifier);
            }

			return new DerSequence(v);
        }
		/**
         * Produce an object suitable for an Asn1OutputStream.
         * <pre>
         * OcspResponse ::= Sequence {
         *     responseStatus         OcspResponseStatus,
         *     responseBytes          [0] EXPLICIT ResponseBytes OPTIONAL }
         * </pre>
         */
        public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(responseStatus);

			if (responseBytes != null)
            {
                v.Add(new DerTaggedObject(true, 0, responseBytes));
            }

			return new DerSequence(v);
        }
Beispiel #10
0
		/**
         * Produce an object suitable for an Asn1OutputStream.
         * <pre>
         * Request         ::=     Sequence {
         *     reqCert                     CertID,
         *     singleRequestExtensions     [0] EXPLICIT Extensions OPTIONAL }
         * </pre>
         */
        public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(reqCert);

			if (singleRequestExtensions != null)
            {
                v.Add(new DerTaggedObject(true, 0, singleRequestExtensions));
            }

			return new DerSequence(v);
        }
		/**
         * Produce an object suitable for an Asn1OutputStream.
         * <pre>
         * ServiceLocator ::= Sequence {
         *     issuer    Name,
         *     locator   AuthorityInfoAccessSyntax OPTIONAL }
         * </pre>
         */
        public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(issuer);

			if (locator != null)
            {
                v.Add(locator);
            }

			return new DerSequence(v);
        }
Beispiel #12
0
		public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector seq = new Asn1EncodableVector(qcStatementId);

			if (qcStatementInfo != null)
            {
                seq.Add(qcStatementInfo);
            }

			return new DerSequence(seq);
        }
Beispiel #13
0
		/**
         * Produce an object suitable for an Asn1OutputStream.
         * <pre>
         * IDEA-CBCPar ::= Sequence {
         *                      iv    OCTET STRING OPTIONAL -- exactly 8 octets
         *                  }
         * </pre>
         */
        public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector();

			if (iv != null)
            {
                v.Add(iv);
            }

			return new DerSequence(v);
        }
Beispiel #14
0
		/**
		 * <pre>
		 * MacData ::= SEQUENCE {
		 *     mac      DigestInfo,
		 *     macSalt  OCTET STRING,
		 *     iterations INTEGER DEFAULT 1
		 *     -- Note: The default is for historic reasons and its use is deprecated. A
		 *     -- higher value, like 1024 is recommended.
		 * </pre>
		 * @return the basic DERObject construction.
		 */
		public override Asn1Object ToAsn1Object()
        {
			Asn1EncodableVector v = new Asn1EncodableVector(digInfo, new DerOctetString(salt));

			if (!iterationCount.Equals(BigInteger.One))
			{
				v.Add(new DerInteger(iterationCount));
			}

			return new DerSequence(v);
        }
Beispiel #15
0
		public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(p, g);

			if (this.l != null)
            {
                v.Add(l);
            }

			return new DerSequence(v);
        }
Beispiel #16
0
		/**
         * Produce an object suitable for an Asn1OutputStream.
         * <pre>
         * OcspRequest     ::=     Sequence {
         *     tbsRequest                  TBSRequest,
         *     optionalSignature   [0]     EXPLICIT Signature OPTIONAL }
         * </pre>
         */
        public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(tbsRequest);

			if (optionalSignature != null)
            {
                v.Add(new DerTaggedObject(true, 0, optionalSignature));
            }

			return new DerSequence(v);
        }
		internal Asn1EncodableVector BuildEncodableVector()
		{
			Asn1EncodableVector v = new Asn1EncodableVector();

			Asn1Object o;
			while ((o = ReadObject()) != null)
			{
				v.Add(o);
			}

			return v;
		}
Beispiel #18
0
		public AttributeTable(
            Asn1EncodableVector v)
        {
            this.attributes = Platform.CreateHashtable(v.Count);

			for (int i = 0; i != v.Count; i++)
            {
                AttributeX509 a = AttributeX509.GetInstance(v[i]);

				attributes.Add(a.AttrType, a);
            }
        }
Beispiel #19
0
		public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(
				bagID, new DerTaggedObject(0, bagValue));

			if (bagAttributes != null)
            {
                v.Add(bagAttributes);
            }

			return new DerSequence(v);
        }
        public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(
                new DerInteger(3), contentInfo);

            if (macData != null)
            {
                v.Add(macData);
            }

            return new BerSequence(v);
        }
Beispiel #21
0
        public static Asn1Set CreateDerSetFromList(
			IList derObjects)
        {
            Asn1EncodableVector v = new Asn1EncodableVector();

            foreach (Asn1Encodable ae in derObjects)
            {
                v.Add(ae);
            }

            return new DerSet(v);
        }
        public AttributeTable(
            Asn1EncodableVector v)
        {
            this.attributes = Platform.CreateHashtable(v.Count);

			foreach (Asn1Encodable o in v)
            {
                Attribute a = Attribute.GetInstance(o);

				AddAttribute(a);
            }
        }
		/**
         * Produce an object suitable for an Asn1OutputStream.
         * <pre>
         * EncryptedContentInfo ::= Sequence {
         *     contentType ContentType,
         *     contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier,
         *     encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL
         * }
         * </pre>
         */
        public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(
				contentType, contentEncryptionAlgorithm);

			if (encryptedContent != null)
            {
                v.Add(new BerTaggedObject(false, 0, encryptedContent));
            }

			return new BerSequence(v);
        }
        public TimeStampResponseGenerator(
            TimeStampTokenGenerator tokenGenerator,
            IList acceptedAlgorithms,
            IList acceptedPolicies,
            IList acceptedExtensions)
        {
            this.tokenGenerator = tokenGenerator;
            this.acceptedAlgorithms = acceptedAlgorithms;
            this.acceptedPolicies = acceptedPolicies;
            this.acceptedExtensions = acceptedExtensions;

            statusStrings = new Asn1EncodableVector();
        }
Beispiel #25
0
        /**
         * Return an ASN1 set from a tagged object. There is a special
         * case here, if an object appears to have been explicitly tagged on
         * reading but we were expecting it to be implicitly tagged in the
         * normal course of events it indicates that we lost the surrounding
         * set - so we need to add it back (this will happen if the tagged
         * object is a sequence that contains other sequences). If you are
         * dealing with implicitly tagged sets you really <b>should</b>
         * be using this method.
         *
         * @param obj the tagged object.
         * @param explicitly true if the object is meant to be explicitly tagged
         *          false otherwise.
         * @exception ArgumentException if the tagged object cannot
         *          be converted.
         */
        public static Asn1Set GetInstance(
            Asn1TaggedObject	obj,
            bool				explicitly)
        {
			Asn1Object inner = obj.GetObject();

			if (explicitly)
            {
                if (!obj.IsExplicit())
                    throw new ArgumentException("object implicit - explicit expected.");

				return (Asn1Set) inner;
            }

			//
            // constructed object which appears to be explicitly tagged
            // and it's really implicit means we have to add the
            // surrounding sequence.
            //
            if (obj.IsExplicit())
            {
                return new DerSet(inner);
            }

			if (inner is Asn1Set)
            {
                return (Asn1Set) inner;
            }

            //
            // in this case the parser returns a sequence, convert it
            // into a set.
            //
			if (inner is Asn1Sequence)
            {
				Asn1EncodableVector v = new Asn1EncodableVector();
				Asn1Sequence s = (Asn1Sequence) inner;

				foreach (Asn1Encodable ae in s)
				{
                    v.Add(ae);
                }

				// TODO Should be able to construct set directly from sequence?
				return new DerSet(v, false);
            }

			throw new ArgumentException("Unknown object in GetInstance: " + obj.GetType().FullName, "obj");
		}
        internal DerSet(
			Asn1EncodableVector	v,
			bool				needsSorting)
            : base(v.Count)
        {
            foreach (Asn1Encodable o in v)
            {
                AddObject(o);
            }

            if (needsSorting)
            {
                Sort();
            }
        }
        private PkiStatusInfo GetPkiStatusInfo()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(
                new DerInteger((int)status));

            if (statusStrings.Count > 0)
            {
                v.Add(new PkiFreeText(new DerSequence(statusStrings)));
            }

            if (failInfo != 0)
            {
                v.Add(new FailInfo(failInfo));
            }

            return new PkiStatusInfo(new DerSequence(v));
        }
		public DerExternal(
			Asn1EncodableVector vector)
		{
			int offset = 0;
			Asn1Object enc = GetObjFromVector(vector, offset);
			if (enc is DerObjectIdentifier)
			{
				directReference = (DerObjectIdentifier)enc;
				offset++;
				enc = GetObjFromVector(vector, offset);
			}
			if (enc is DerInteger)
			{
				indirectReference = (DerInteger) enc;
				offset++;
				enc = GetObjFromVector(vector, offset);
			}
			if (!(enc is DerTaggedObject))
			{
				dataValueDescriptor = (Asn1Object) enc;
				offset++;
				enc = GetObjFromVector(vector, offset);
			}
			if (!(enc is DerTaggedObject))
			{
				throw new InvalidOperationException(
					"No tagged object found in vector. Structure doesn't seem to be of type External");
			}

			if (vector.Count != offset + 1)
				throw new ArgumentException("input vector too large", "vector");

			if (!(enc is DerTaggedObject))
				throw new ArgumentException("No tagged object found in vector. Structure doesn't seem to be of type External", "vector");

			DerTaggedObject obj = (DerTaggedObject)enc;

			// Use property accessor to include check on value
			Encoding = obj.TagNo;

			if (encoding < 0 || encoding > 2)
				throw new InvalidOperationException("invalid encoding value");

			externalContent = obj.GetObject();
		}
Beispiel #29
0
        internal Asn1EncodableVector ReadVector()
        {
            Asn1EncodableVector v = new Asn1EncodableVector();
            try
            {
                IAsn1Convertible obj;
                while ((obj = ReadObject()) != null)
                {
                    v.Add(obj.ToAsn1Object());
                }
            }
            catch (IOException e)
            {
                throw new InvalidOperationException(e.Message, e);
            }

            return v;
        }
		/**
		 * endEntity cert
		 */
		private X509Certificate CreateEndEntityCert(
			AsymmetricKeyParameter pubKey,
			AsymmetricKeyParameter caPrivKey,
			AsymmetricKeyParameter caPubKey,
			Asn1EncodableVector policies)
		{
			string issuer = "C=JP, O=policyMappingAdditionalTest, OU=intMedCA";
			string subject = "C=JP, O=policyMappingAdditionalTest, OU=endEntity";
			v3CertGen.Reset();
			v3CertGen.SetSerialNumber(BigInteger.ValueOf(20));
			v3CertGen.SetIssuerDN(new X509Name(issuer));
			v3CertGen.SetNotBefore(DateTime.UtcNow.AddDays(-30));
			v3CertGen.SetNotAfter(DateTime.UtcNow.AddDays(30));
			v3CertGen.SetSubjectDN(new X509Name(subject));
			v3CertGen.SetPublicKey(pubKey);
			v3CertGen.SetSignatureAlgorithm("SHA1WithRSAEncryption");
			v3CertGen.AddExtension(X509Extensions.CertificatePolicies, true, new DerSequence(policies));
			X509Certificate cert = v3CertGen.Generate(caPrivKey);
			return cert;
		}
Beispiel #31
0
        /**
         * build an object given its tag and a byte stream to construct it
         * from.
         */
        internal Asn1Object BuildObject(
            int tag,
            int tagNo,
            byte[]      bytes)
        {
            if ((tag & Asn1Tags.Application) != 0)
            {
                return(new DerApplicationSpecific(tagNo, bytes));
            }

            switch (tag)
            {
            case Asn1Tags.Null:
                return(DerNull.Instance);

            case Asn1Tags.Sequence | Asn1Tags.Constructed:
            {
                Asn1EncodableVector v = BuildDerEncodableVector(bytes);
                return(new DerSequence(v));
            }

            case Asn1Tags.Set | Asn1Tags.Constructed:
            {
                Asn1EncodableVector v = BuildDerEncodableVector(bytes);
                return(new DerSet(v, false));
            }

            case Asn1Tags.Boolean:
                return(new DerBoolean(bytes));

            case Asn1Tags.Integer:
                return(new DerInteger(bytes));

            case Asn1Tags.Enumerated:
                return(new DerEnumerated(bytes));

            case Asn1Tags.ObjectIdentifier:
                return(new DerObjectIdentifier(bytes));

            case Asn1Tags.BitString:
            {
                int    padBits = bytes[0];
                byte[] data    = new byte[bytes.Length - 1];
                Array.Copy(bytes, 1, data, 0, bytes.Length - 1);
                return(new DerBitString(data, padBits));
            }

            case Asn1Tags.NumericString:
                return(new DerNumericString(bytes));

            case Asn1Tags.Utf8String:
                return(new DerUtf8String(bytes));

            case Asn1Tags.PrintableString:
                return(new DerPrintableString(bytes));

            case Asn1Tags.IA5String:
                return(new DerIA5String(bytes));

            case Asn1Tags.T61String:
                return(new DerT61String(bytes));

            case Asn1Tags.VisibleString:
                return(new DerVisibleString(bytes));

            case Asn1Tags.GeneralString:
                return(new DerGeneralString(bytes));

            case Asn1Tags.UniversalString:
                return(new DerUniversalString(bytes));

            case Asn1Tags.BmpString:
                return(new DerBmpString(bytes));

            case Asn1Tags.OctetString:
                return(new DerOctetString(bytes));

            case Asn1Tags.OctetString | Asn1Tags.Constructed:
                return(BuildDerConstructedOctetString(bytes));

            case Asn1Tags.UtcTime:
                return(new DerUtcTime(bytes));

            case Asn1Tags.GeneralizedTime:
                return(new DerGeneralizedTime(bytes));

            default:
            {
                //
                // with tagged object tag number is bottom 5 bits
                //
                if ((tag & (int)Asn1Tags.Tagged) != 0)
                {
                    bool isImplicit = ((tag & (int)Asn1Tags.Constructed) == 0);

                    if (bytes.Length == 0)                                    // empty tag!
                    {
                        Asn1Encodable ae = isImplicit
                                                                ?       (Asn1Encodable)DerNull.Instance
                                                                :       new DerSequence();

                        return(new DerTaggedObject(false, tagNo, ae));
                    }

                    //
                    // simple type - implicit... return an octet string
                    //
                    if (isImplicit)
                    {
                        return(new DerTaggedObject(false, tagNo, new DerOctetString(bytes)));
                    }

                    Asn1InputStream aIn  = new Asn1InputStream(bytes);
                    Asn1Encodable   dObj = aIn.ReadObject();


                    // explicitly tagged (probably!) - if it isn't we'd have to
                    // tell from the context

                    //if (aIn.available() == 0)
                    if (aIn.Position == bytes.Length)                             //FIXME?
                    {
                        return(new DerTaggedObject(tagNo, dObj));
                    }

                    //
                    // another implicit object, we'll create a sequence...
                    //
                    Asn1EncodableVector v = new Asn1EncodableVector();

                    while (dObj != null)
                    {
                        v.Add(dObj);
                        dObj = aIn.ReadObject();
                    }

                    return(new DerTaggedObject(false, tagNo, new DerSequence(v)));
                }

                return(new DerUnknownTag(tag, bytes));
            }
            }
        }
Beispiel #32
0
        public Asn1Object ReadObject()
        {
            int tag = ReadByte();

            if (tag == -1)
            {
                if (eofFound)
                {
                    throw new EndOfStreamException("attempt to read past end of file.");
                }

                eofFound = true;

                return(null);
            }

            int tagNo = 0;

            if ((tag & Asn1Tags.Tagged) != 0 || (tag & Asn1Tags.Application) != 0)
            {
                tagNo = ReadTagNumber(tag);
            }

            int length = ReadLength();

            if (length < 0)                // indefinite length method
            {
                switch (tag)
                {
                case Asn1Tags.Null:
                    return(BerNull.Instance);

                case Asn1Tags.Sequence | Asn1Tags.Constructed:
                {
                    Asn1EncodableVector v = BuildEncodableVector(EndOfStream);
                    return(new BerSequence(v));
                }

                case Asn1Tags.Set | Asn1Tags.Constructed:
                {
                    Asn1EncodableVector v = BuildEncodableVector(EndOfStream);
                    return(new BerSet(v, false));
                }

                case Asn1Tags.OctetString | Asn1Tags.Constructed:
                    return(BuildConstructedOctetString(EndOfStream));

                default:
                {
                    //
                    // with tagged object tag number is bottom 5 bits
                    //
                    if ((tag & (int)Asn1Tags.Tagged) != 0)
                    {
                        //
                        // simple type - implicit... return an octet string
                        //
                        if ((tag & (int)Asn1Tags.Constructed) == 0)
                        {
                            byte[] bytes = ReadIndefiniteLengthFully();

                            return(new BerTaggedObject(false, tagNo, new DerOctetString(bytes)));
                        }

                        //
                        // either constructed or explicitly tagged
                        //
                        Asn1Object dObj = ReadObject();

                        if (dObj == EndOfStream)                                     // empty tag!
                        {
                            return(new DerTaggedObject(tagNo));
                        }

                        Asn1Object next = ReadObject();

                        //
                        // explicitly tagged (probably!) - if it isn't we'd have to
                        // tell from the context
                        //
                        if (next == EndOfStream)
                        {
                            return(new BerTaggedObject(tagNo, dObj));
                        }

                        //
                        // another implicit object, we'll create a sequence...
                        //
                        Asn1EncodableVector v = new Asn1EncodableVector(dObj);

                        do
                        {
                            v.Add(next);
                            next = ReadObject();
                        }while (next != EndOfStream);

                        return(new BerTaggedObject(false, tagNo, new BerSequence(v)));
                    }

                    throw new IOException("unknown Ber object encountered");
                }
                }
            }
            else
            {
                if (tag == 0 && length == 0)    // end of contents marker.
                {
                    return(EndOfStream);
                }

                byte[] bytes = new byte[length];

                ReadFully(bytes);

                return(BuildObject(tag, tagNo, bytes));
            }
        }
Beispiel #33
0
 public static DerSequence FromVector(Asn1EncodableVector elementVector)
 {
     return(elementVector.Count < 1 ? Empty : new DerSequence(elementVector));
 }
Beispiel #34
0
 /**
  * create a sequence containing a vector of objects.
  */
 public DerSequence(Asn1EncodableVector elementVector)
     : base(elementVector)
 {
 }
Beispiel #35
0
 internal new static BerSet FromVector(Asn1EncodableVector v, bool needsSorting)
 {
     return((v.Count >= 1) ? new BerSet(v, needsSorting) : Empty);
 }
 /**
  * create a set containing a vector of objects.
  */
 public BerSet(Asn1EncodableVector v) : base(v, false)
 {
 }
Beispiel #37
0
 public BerSequence(Asn1EncodableVector v) : base(v)
 {
 }
Beispiel #38
0
 public static BerSequence FromVector(Asn1EncodableVector v) =>
 ((v.Count >= 1) ? new BerSequence(v) : Empty);
Beispiel #39
0
 public static DerSet FromVector(
     Asn1EncodableVector v)
 {
     return(v.Count < 1 ? Empty : new DerSet(v));
 }
Beispiel #40
0
 internal static DerSet FromVector(
     Asn1EncodableVector v,
     bool needsSorting)
 {
     return(v.Count < 1 ? Empty : new DerSet(v, needsSorting));
 }
Beispiel #41
0
 /**
  * @param v - a vector of objects making up the set.
  */
 public DerSet(
     Asn1EncodableVector v)
     : this(v, true)
 {
 }
Beispiel #42
0
 public virtual Asn1Encodable[] ToArray()
 {
     return(Asn1EncodableVector.CloneElements(elements));
 }
 internal BerSet(Asn1EncodableVector v, bool needsSorting) : base(v, needsSorting)
 {
 }
 public BerApplicationSpecific(int tagNo, Asn1EncodableVector vec) : base(tagNo, vec)
 {
 }
Beispiel #45
0
 internal static DerSet FromVector(Asn1EncodableVector v, bool needsSorting) =>
 ((v.Count >= 1) ? new DerSet(v, needsSorting) : Empty);
Beispiel #46
0
 public static DerSet FromVector(Asn1EncodableVector v) =>
 ((v.Count >= 1) ? new DerSet(v) : Empty);
Beispiel #47
0
 public BerSet(Asn1EncodableVector v)
     : base(v, needsSorting: false)
 {
 }
Beispiel #48
0
 public new static BerSet FromVector(Asn1EncodableVector v)
 {
     return((v.Count >= 1) ? new BerSet(v) : Empty);
 }