private static void WriteEncodable(MemoryStream ms, Asn1Encodable e) { if (e != null) { byte[] bs = e.GetDerEncoded(); ms.Write(bs, 0, bs.Length); } }
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 DerBitString( Asn1Encodable obj) { this.data = obj.GetDerEncoded(); //this.padBits = 0; }