Ejemplo n.º 1
0
        protected internal void Sort()
        {
            if (_set.Count < 2)
            {
                return;
            }

            Asn1Encodable[] items = new Asn1Encodable[_set.Count];
            byte[][]        keys  = new byte[_set.Count][];

            for (int i = 0; i < _set.Count; ++i)
            {
                Asn1Encodable item = (Asn1Encodable)_set[i];
                items[i] = item;
                keys[i]  = item.GetEncoded(Asn1Encodable.Der);
            }

            items = keys.Select((k, i) =>
                                new
            {
                Key   = k,
                Value = items[i]
            })
                    .OrderBy(o => o.Key, new DerComparer())
                    .Select(o => o.Value)
                    .ToArray();

            for (int i = 0; i < _set.Count; ++i)
            {
                _set[i] = items[i];
            }
        }
Ejemplo n.º 2
0
        internal Asn1OctetString(
            Asn1Encodable obj)
        {
            try
            {
				this.str = obj.GetEncoded(Asn1Encodable.Der);
            }
            catch (IOException e)
            {
                throw new ArgumentException("Error processing object : " + e.ToString());
            }
        }
Ejemplo n.º 3
0
 internal Asn1OctetString(
     Asn1Encodable obj)
 {
     try
     {
         this.str = obj.GetEncoded(Asn1Encodable.Der);
     }
     catch (IOException e)
     {
         throw new ArgumentException("Error processing object : " + e.ToString());
     }
 }