Exemple #1
0
        public DerApplicationSpecific(
            bool isExplicit,
            int tag,
            Asn1Encodable obj)
        {
            Asn1Object asn1Obj = obj.ToAsn1Object();

            byte[] data = asn1Obj.GetDerEncoded();

            this.isConstructed = Asn1TaggedObject.IsConstructed(isExplicit, asn1Obj);
            this.tag           = tag;

            if (isExplicit)
            {
                this.octets = data;
            }
            else
            {
                int    lenBytes = GetLengthOfHeader(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())
 {
 }