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); }
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); }
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; }