Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <strong>Asn1ObjectIdentifier</strong> class from an existing
 /// <see cref="Asn1Reader"/> class instance.
 /// </summary>
 /// <param name="asn"><see cref="Asn1Reader"/> object in the position that represents object identifier.</param>
 /// <exception cref="Asn1InvalidTagException">
 /// The current state of <strong>ASN1</strong> object is not object identifier.
 /// </exception>
 ///
 public Asn1ObjectIdentifier(Asn1Reader asn) : base(asn)
 {
     if (asn.Tag != TAG)
     {
         throw new Asn1InvalidTagException(String.Format(InvalidType, TYPE.ToString()));
     }
     m_decode(asn);
 }
 /// <summary>
 /// Initializes a new instance of the <strong>Asn1NumericString</strong> class from an <see cref="Asn1Reader"/>
 /// object.
 /// </summary>
 /// <param name="asn">Existing <see cref="Asn1Reader"/> object.</param>
 /// <exception cref="Asn1InvalidTagException">
 /// Current position in the <strong>ASN.1</strong> object is not <strong>NumericString</strong> data type.
 /// </exception>
 /// <exception cref="InvalidDataException">
 /// Input data contains invalid NumericString character.
 /// </exception>
 public Asn1OctetString(Asn1Reader asn) : base(asn)
 {
     if (asn.Tag != TAG)
     {
         throw new Asn1InvalidTagException(String.Format(InvalidType, TYPE.ToString()));
     }
     Value = asn.GetPayload();
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <strong>Asn1UtcTime</strong> class from an existing
 /// <see cref="Asn1Reader"/> object.
 /// </summary>
 /// <param name="asn"><see cref="Asn1Reader"/> object in the position that represents UTC time.</param>
 /// <exception cref="Asn1InvalidTagException">
 /// The current state of <strong>ASN1</strong> object is not UTC time.
 /// </exception>
 public Asn1UtcTime(Asn1Reader asn) : base(asn)
 {
     if (asn.Tag != TAG)
     {
         throw new Asn1InvalidTagException(String.Format(InvalidType, TYPE.ToString()));
     }
     m_decode(asn.GetTagRawData());
 }
 /// <summary>
 /// Initializes a new instance of the <strong>Asn1UniversalString</strong> class from an <see cref="Asn1Reader"/>
 /// object.
 /// </summary>
 /// <param name="asn">Existing <see cref="Asn1Reader"/> object.</param>
 /// <exception cref="Asn1InvalidTagException">
 /// Current position in the <strong>ASN.1</strong> object is not <strong>UniversalString</strong> data type.
 /// </exception>
 public Asn1UniversalString(Asn1Reader asn) : base(asn)
 {
     if (asn.Tag != TAG)
     {
         throw new Asn1InvalidTagException(String.Format(InvalidType, TYPE.ToString()));
     }
     m_decode(asn);
 }
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the <strong>Asn1BitString</strong> class from an <see cref="Asn1Reader"/>
 /// object.
 /// </summary>
 /// <param name="asn">Existing <see cref="Asn1Reader"/> object.</param>
 /// <exception cref="Asn1InvalidTagException">
 /// Current position in the <strong>ASN.1</strong> object is not <strong>BIT_STRING</strong> data type.
 /// </exception>
 public Asn1BitString(Asn1Reader asn) : base(asn)
 {
     if (asn.Tag != TAG)
     {
         throw new Asn1InvalidTagException(String.Format(InvalidType, TYPE.ToString()));
     }
     UnusedBits = asn.RawData[asn.PayloadStartOffset];
     Value      = asn.GetPayload().Skip(1).ToArray();
 }