Esempio n. 1
0
 public UserNotice(
     Asn1Sequence seq)
 {
     if (seq.Count == 2)
     {
         noticeRef    = NoticeReference.GetInstance(seq[0]);
         explicitText = DisplayText.GetInstance(seq[1]);
     }
     else if (seq.Count == 1)
     {
         if (seq[0].ToAsn1Object() is Asn1Sequence)
         {
             noticeRef    = NoticeReference.GetInstance(seq[0]);
             explicitText = null;
         }
         else
         {
             noticeRef    = null;
             explicitText = DisplayText.GetInstance(seq[0]);
         }
     }
     else if (seq.Count == 0)
     {
         noticeRef    = null;    // neither field set!
         explicitText = null;
     }
     else
     {
         throw new ArgumentException("Bad sequence size: " + seq.Count);
     }
 }
Esempio n. 2
0
        /**
         * Creates a new <code>NoticeReference</code> instance.
         * <p>Useful for reconstructing a <code>NoticeReference</code>
         * instance from its encodable/encoded form.</p>
         *
         * @param as an <code>Asn1Sequence</code> value obtained from either
         * calling @{link ToAsn1Object()} for a <code>NoticeReference</code>
         * instance or from parsing it from a Der-encoded stream.
         */
        private NoticeReference(Asn1Sequence seq)
        {
            if (seq.Count != 2)
            {
                throw new ArgumentException("Bad sequence size: " + seq.Count, "seq");
            }

            organization  = DisplayText.GetInstance(seq[0]);
            noticeNumbers = Asn1Sequence.GetInstance(seq[1]);
        }