コード例 #1
0
ファイル: Asn1Type.cs プロジェクト: xdios/GostCryptography
        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);
        }
コード例 #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);
        }
コード例 #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;
        }