Exemplo n.º 1
0
        protected virtual int MatchTag(Asn1BerDecodeBuffer buffer, short tagClass, short tagForm, int tagIdCode)
        {
            if (!buffer.MatchTag(tagClass, tagForm, tagIdCode, _parsedTag, _parsedLen))
            {
                throw ExceptionUtility.CryptographicException(Resources.Asn1TagMatchFailedException, new Asn1Tag(tagClass, tagForm, tagIdCode), _parsedTag, buffer.ByteCount);
            }

            return(_parsedLen.Value);
        }
Exemplo n.º 2
0
        public virtual bool Expired()
        {
            if (_elemLength == Asn1Status.IndefiniteLength)
            {
                var parsedLen = new IntHolder();
                var flag      = _decodeBuffer.MatchTag(0, 0, 0, null, parsedLen);

                if (flag)
                {
                    _decodeBuffer.Reset();
                }

                return(flag);
            }

            var num = _decodeBuffer.ByteCount - _decBufByteCount;

            return(num >= _elemLength);
        }
Exemplo n.º 3
0
        protected virtual int MatchTag(Asn1BerDecodeBuffer buffer, short tagClass, short tagForm, int tagIdCode)
        {
            if (!buffer.MatchTag(tagClass, tagForm, tagIdCode, _parsedTag, _parsedLen))
            {
                throw ExceptionUtility.CryptographicException(Resources.Asn1TagMatchFailedException, new Asn1Tag(tagClass, tagForm, tagIdCode), _parsedTag, buffer.ByteCount);
            }

            return _parsedLen.Value;
        }