123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
- using System;
- using System.Collections;
- using Org.BouncyCastle.Utilities;
- namespace Org.BouncyCastle.Asn1
- {
- public class Asn1EncodableVector
- : IEnumerable
- {
- private IList v = Org.BouncyCastle.Utilities.Platform.CreateArrayList();
- public static Asn1EncodableVector FromEnumerable(
- IEnumerable e)
- {
- Asn1EncodableVector v = new Asn1EncodableVector();
- foreach (Asn1Encodable obj in e)
- {
- v.Add(obj);
- }
- return v;
- }
- // public Asn1EncodableVector()
- // {
- // }
- public Asn1EncodableVector(
- params Asn1Encodable[] v)
- {
- Add(v);
- }
- // public void Add(
- // Asn1Encodable obj)
- // {
- // v.Add(obj);
- // }
- public void Add(
- params Asn1Encodable[] objs)
- {
- foreach (Asn1Encodable obj in objs)
- {
- v.Add(obj);
- }
- }
- public void AddOptional(
- params Asn1Encodable[] objs)
- {
- if (objs != null)
- {
- foreach (Asn1Encodable obj in objs)
- {
- if (obj != null)
- {
- v.Add(obj);
- }
- }
- }
- }
- public Asn1Encodable this[
- int index]
- {
- get { return (Asn1Encodable) v[index]; }
- }
- [Obsolete("Use 'object[index]' syntax instead")]
- public Asn1Encodable Get(
- int index)
- {
- return this[index];
- }
- [Obsolete("Use 'Count' property instead")]
- public int Size
- {
- get { return v.Count; }
- }
- public int Count
- {
- get { return v.Count; }
- }
- public IEnumerator GetEnumerator()
- {
- return v.GetEnumerator();
- }
- }
- }
- #endif
|