Home | History | Annotate | Download | only in asn1
      1 package org.bouncycastle.asn1;
      2 
      3 import java.io.IOException;
      4 
      5 public class BERSequenceParser
      6     implements ASN1SequenceParser
      7 {
      8     private ASN1StreamParser _parser;
      9 
     10     BERSequenceParser(ASN1StreamParser parser)
     11     {
     12         this._parser = parser;
     13     }
     14 
     15     public ASN1Encodable readObject()
     16         throws IOException
     17     {
     18         return _parser.readObject();
     19     }
     20 
     21     public ASN1Primitive getLoadedObject()
     22         throws IOException
     23     {
     24         return new BERSequence(_parser.readVector());
     25     }
     26 
     27     public ASN1Primitive toASN1Primitive()
     28     {
     29         try
     30         {
     31             return getLoadedObject();
     32         }
     33         catch (IOException e)
     34         {
     35             throw new IllegalStateException(e.getMessage());
     36         }
     37     }
     38 }
     39