/** * @param explicitly true if an explicitly tagged object. * @param tagNo the tag number for this object. * @param obj the tagged object. */ public BerTaggedObject( bool explicitly, int tagNo, Asn1Encodable obj) : base(explicitly, tagNo, obj) { }
/** * @param tagNo the tag number for this object. * @param obj the tagged object. */ protected Asn1TaggedObject( int tagNo, Asn1Encodable obj) { this.explicitly = true; this.tagNo = tagNo; this.obj = obj; }
/** * @param explicitly true if the object is explicitly tagged. * @param tagNo the tag number for this object. * @param obj the tagged object. */ protected Asn1TaggedObject( bool explicitly, int tagNo, Asn1Encodable obj) { // IAsn1Choice marker interface 'insists' on explicit tagging this.explicitly = explicitly || (obj is IAsn1Choice); this.tagNo = tagNo; this.obj = obj; }
internal Asn1OctetString( Asn1Encodable obj) { try { this.str = obj.GetEncoded(Asn1Encodable.Der); } catch (IOException e) { throw new ArgumentException("Error processing object : " + e.ToString()); } }
public DerApplicationSpecific( bool isExplicit, int tag, Asn1Encodable obj) { byte[] data = obj.GetDerEncoded(); this.isConstructed = isExplicit; this.tag = tag; if (isExplicit) { this.octets = data; } else { int lenBytes = GetLengthOfLength(data); byte[] tmp = new byte[data.Length - lenBytes]; Array.Copy(data, lenBytes, tmp, 0, tmp.Length); this.octets = tmp; } }
public BerOctetString( Asn1Encodable obj) : base(obj.ToAsn1Object()) { }
protected internal void AddObject( Asn1Encodable obj) { seq.Add(obj); }
public override void AddObject( Asn1Encodable obj) { new DerOutputStream(_bOut).WriteObject(obj); }
private static void WriteEncodable(MemoryStream ms, Asn1Encodable e) { if (e != null) { byte[] bs = e.GetDerEncoded(); ms.Write(bs, 0, bs.Length); } }
public virtual void WriteObject( Asn1Encodable obj) { if (obj == null) { WriteNull(); } else { obj.ToAsn1Object().Encode(this); } }
/** * create a sequence containing one object */ public DerSequence( Asn1Encodable obj) : base(1) { AddObject(obj); }
public virtual Asn1Encodable[] ToArray() { Asn1Encodable[] values = new Asn1Encodable[this.Count]; for (int i = 0; i < this.Count; ++i) { values[i] = this[i]; } return values; }
public abstract void AddObject(Asn1Encodable obj);
public DerApplicationSpecific( int tag, Asn1Encodable obj) : this(true, tag, obj) { }
/** * @param tagNo the tag number for this object. * @param obj the tagged object. */ public BerTaggedObject( int tagNo, Asn1Encodable obj) : base(tagNo, obj) { }
public DerBitString( Asn1Encodable obj) { this.data = obj.GetDerEncoded(); //this.padBits = 0; }
/** * @param obj - a single object that makes up the set. */ public DerSet( Asn1Encodable obj) : base(1) { AddObject(obj); }