BERConstructedSequence.java
上传用户:lior1029
上传日期:2013-05-07
资源大小:209k
文件大小:1k
源码类别:

CA认证

开发平台:

Java

  1. package org.bouncycastle.asn1;
  2. import java.io.*;
  3. import java.util.*;
  4. public class BERConstructedSequence
  5.     extends DERConstructedSequence
  6. {
  7.     /*
  8.      */
  9.     void encode(
  10.         DEROutputStream out)
  11.         throws IOException
  12.     {
  13.         if (out instanceof ASN1OutputStream || out instanceof BEROutputStream)
  14.         {
  15.             out.write(SEQUENCE | CONSTRUCTED);
  16.             out.write(0x80);
  17.             
  18.             Enumeration e = getObjects();
  19.             while (e.hasMoreElements())
  20.             {
  21.                 out.writeObject(e.nextElement());
  22.             }
  23.         
  24.             out.write(0x00);
  25.             out.write(0x00);
  26.         }
  27.         else
  28.         {
  29.             super.encode(out);
  30.         }
  31.     }
  32. }