22using System . Runtime . InteropServices ;
33using System . Runtime . Serialization ;
44
5- namespace SysadminsLV . Asn1Parser {
5+ namespace SysadminsLV . Asn1Parser ;
6+
7+ /// <summary>
8+ /// The exception that is thrown when a data stream contains invalid ASN.1 type or type is not the one client expects.
9+ /// </summary>
10+ [ Serializable ]
11+ [ ComVisible ( true ) ]
12+ public sealed class Asn1InvalidTagException : Exception {
13+ /// <inheritdoc />
14+ public Asn1InvalidTagException ( )
15+ : base ( "ASN1 bad tag value met." ) {
16+ HResult = unchecked ( ( Int32 ) 0x8009310b ) ;
17+ }
18+ /// <inheritdoc />
19+ public Asn1InvalidTagException ( String message ) : base ( message ) {
20+ HResult = unchecked ( ( Int32 ) 0x8009310b ) ;
21+ }
22+ /// <inheritdoc />
23+ public Asn1InvalidTagException ( Int32 offset )
24+ : base ( $ "ASN1 bad tag value met at offset:{ offset } .") {
25+ HResult = unchecked ( ( Int32 ) 0x8009310b ) ;
26+ Offset = offset ;
27+ }
28+ /// <inheritdoc />
29+ public Asn1InvalidTagException ( Exception innerException )
30+ : base ( "ASN1 bad tag value met." , innerException ) {
31+ HResult = unchecked ( ( Int32 ) 0x8009310b ) ;
32+ }
33+ /// <param name="message">The error message that explains the reason for the exception.</param>
34+ /// <param name="innerException">
35+ /// The exception that is the cause of the current exception. If the <strong>innerException</strong> parameter is not a null
36+ /// reference, the current exception is raised in a catch block that handles the inner exception.
37+ /// </param>
38+ public Asn1InvalidTagException ( String message , Exception innerException ) : base ( message , innerException ) { }
39+ /// <param name="info">The object that holds the serialized object data.</param>
40+ /// <param name="context">The contextual information about the source or destination.</param>
41+ /// <remarks>This constructor is called during deserialization to reconstitute the exception object transmitted over a stream.</remarks>
42+ public Asn1InvalidTagException ( SerializationInfo info , StreamingContext context ) : base ( info , context ) { }
643 /// <summary>
7- /// The exception that is thrown when a data stream contains invalid ASN.1 type or type is not the one client expects .
44+ /// Gets the offset at which invalid ASN tag appear .
845 /// </summary>
9- [ Serializable ]
10- [ ComVisible ( true ) ]
11- public sealed class Asn1InvalidTagException : Exception {
12- /// <inheritdoc />
13- public Asn1InvalidTagException ( )
14- : base ( "ASN1 bad tag value met." ) {
15- HResult = unchecked ( ( Int32 ) 0x8009310b ) ;
16- }
17- /// <inheritdoc />
18- public Asn1InvalidTagException ( String message ) : base ( message ) {
19- HResult = unchecked ( ( Int32 ) 0x8009310b ) ;
20- }
21- /// <inheritdoc />
22- public Asn1InvalidTagException ( Int32 offset )
23- : base ( $ "ASN1 bad tag value met at offset:{ offset } .") {
24- HResult = unchecked ( ( Int32 ) 0x8009310b ) ;
25- Offset = offset ;
26- }
27- /// <inheritdoc />
28- public Asn1InvalidTagException ( Exception innerException )
29- : base ( "ASN1 bad tag value met." , innerException ) {
30- HResult = unchecked ( ( Int32 ) 0x8009310b ) ;
31- }
32- /// <param name="message">The error message that explains the reason for the exception.</param>
33- /// <param name="innerException">
34- /// The exception that is the cause of the current exception. If the <strong>innerException</strong> parameter is not a null
35- /// reference, the current exception is raised in a catch block that handles the inner exception.
36- /// </param>
37- public Asn1InvalidTagException ( String message , Exception innerException ) : base ( message , innerException ) { }
38- /// <param name="info">The object that holds the serialized object data.</param>
39- /// <param name="context">The contextual information about the source or destination.</param>
40- /// <remarks>This constructor is called during deserialization to reconstitute the exception object transmitted over a stream.</remarks>
41- public Asn1InvalidTagException ( SerializationInfo info , StreamingContext context ) : base ( info , context ) { }
42- /// <summary>
43- /// Gets the offset at which invalid ASN tag appear.
44- /// </summary>
45- public Int32 Offset { get ; private set ; }
46- }
47- }
46+ public Int32 Offset { get ; private set ; }
47+ }
0 commit comments