• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.bouncycastle.asn1;
2 
3 import java.io.IOException;
4 
5 /**
6  * @deprecated Use DLSequenceParser instead
7  */
8 public class DERSequenceParser
9     implements ASN1SequenceParser
10 {
11     private ASN1StreamParser _parser;
12 
DERSequenceParser(ASN1StreamParser parser)13     DERSequenceParser(ASN1StreamParser parser)
14     {
15         this._parser = parser;
16     }
17 
18     /**
19      * Return the next object in the SEQUENCE.
20      *
21      * @return next object in SEQUENCE.
22      * @throws IOException if there is an issue loading the object.
23      */
readObject()24     public ASN1Encodable readObject()
25         throws IOException
26     {
27         return _parser.readObject();
28     }
29 
30     /**
31      * Return an in memory, encodable, representation of the SEQUENCE.
32      *
33      * @return a DERSequence.
34      * @throws IOException if there is an issue loading the data.
35      */
getLoadedObject()36     public ASN1Primitive getLoadedObject()
37         throws IOException
38     {
39          return new DLSequence(_parser.readVector());
40     }
41 
42     /**
43      * Return a DERSequence representing this parser and its contents.
44      *
45      * @return a DERSequence.
46      */
toASN1Primitive()47     public ASN1Primitive toASN1Primitive()
48     {
49         try
50         {
51             return getLoadedObject();
52         }
53         catch (IOException e)
54         {
55             throw new IllegalStateException(e.getMessage());
56         }
57     }
58 }
59