Beispiel #1
0
        public static AsnOctetstring Decode(byte[] source, ref int pos)
        {
            AsnOctetstring instance = new AsnOctetstring();

            //CheckContextTag(source, ref pos);
            pos++;

            int length = instance.GetLength(source, ref pos);

            instance.value = new byte[length];
            Array.Copy(source, pos, instance.value, 0, length);
            pos += length;

            return(instance);
        }
Beispiel #2
0
        public static AsnExtension Decode(byte[] source, ref int pos)
        {
            AsnExtension instance = new AsnExtension();

            pos++;

            long len = instance.GetLength(source, ref pos);

            instance.extnID = AsnOid.Decode(source, ref pos);

            if (source[pos] == 0x1)
            {
                instance.critical = AsnBoolean.Decode(source, ref pos);
            }

            instance.extnValue = AsnOctetstring.Decode(source, ref pos);

            return(instance);
        }
Beispiel #3
0
 public AsnExtension(string oid, bool isCritical, byte[] value)
 {
     extnID    = new AsnOid(oid);
     critical  = new AsnBoolean(isCritical);
     extnValue = new AsnOctetstring(value);
 }