Пример #1
0
 /**
  * Creates a new <code>UserNotice</code> instance.
  * <p>Useful from reconstructing a <code>UserNotice</code> instance
  * from its encodable/encoded form.
  *
  * @param as an <code>ASN1Sequence</code> value obtained from either
  * calling @{link toASN1Object()} for a <code>UserNotice</code>
  * instance or from parsing it from a DER-encoded stream.
  */
 public UserNotice(
     ASN1Sequence aseq)
 {
     if (aseq.size() == 2)
     {
         noticeRef    = NoticeReference.getInstance(aseq.getObjectAt(0));
         explicitText = DisplayText.getInstance(aseq.getObjectAt(1));
     }
     else if (aseq.size() == 1)
     {
         if (aseq.getObjectAt(0).toASN1Object() is ASN1Sequence)
         {
             noticeRef = NoticeReference.getInstance(aseq.getObjectAt(0));
         }
         else
         {
             explicitText = DisplayText.getInstance(aseq.getObjectAt(0));
         }
     }
 }
Пример #2
0
        /**
         * Creates a new <code>NoticeReference</code> instance.
         *
         * @param orgName a <code>String</code> value
         * @param numbers a <code>Vector</code> value
         */
        public NoticeReference(string orgName, ArrayList numbers)
        {
            organization = new DisplayText(orgName);

            object o = numbers[0];

            ASN1EncodableVector av = new ASN1EncodableVector();

            if (o is Int32)
            {
                IEnumerator it = numbers.GetEnumerator();

                while (it.MoveNext())
                {
                    Int32      nm = (Int32)it.Current;
                    DERInteger di = new DERInteger((int)nm);
                    av.add(di);
                }
            }

            noticeNumbers = new DERSequence(av);
        }
Пример #3
0
 /**
  * Creates a new <code>NoticeReference</code> instance.
  * <p>Useful for reconstructing a <code>NoticeReference</code>
  * instance from its encodable/encoded form.
  *
  * @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.
  */
 public NoticeReference(ASN1Sequence aseq)
 {
     organization  = DisplayText.getInstance(aseq.getObjectAt(0));
     noticeNumbers = (ASN1Sequence)aseq.getObjectAt(1);
 }
Пример #4
0
 /**
  * Creates a new <code>NoticeReference</code> instance.
  *
  * @param orgName a <code>String</code> value
  * @param numbers an <code>ASN1EncodableVector</code> value
  */
 public NoticeReference(string orgName, ASN1Sequence numbers)
 {
     organization  = new DisplayText(orgName);
     noticeNumbers = numbers;
 }