DERSetParser.java revision e6bf3e8dfa2804891a82075cb469b736321b4827
1package org.bouncycastle.asn1;
2
3import java.io.IOException;
4
5public class DERSetParser
6    implements ASN1SetParser
7{
8    private ASN1StreamParser _parser;
9
10    DERSetParser(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 DERSet(_parser.readVector(), false);
25    }
26
27    public ASN1Primitive toASN1Primitive()
28    {
29        try
30        {
31            return getLoadedObject();
32        }
33        catch (IOException e)
34        {
35            throw new ASN1ParsingException(e.getMessage(), e);
36        }
37    }
38}
39