001package org.apache.commons.ssl.org.bouncycastle.asn1;
002
003import java.io.IOException;
004
005public class DERSetParser
006    implements ASN1SetParser
007{
008    private ASN1StreamParser _parser;
009
010    DERSetParser(ASN1StreamParser parser)
011    {
012        this._parser = parser;
013    }
014
015    public ASN1Encodable readObject()
016        throws IOException
017    {
018        return _parser.readObject();
019    }
020
021    public ASN1Primitive getLoadedObject()
022        throws IOException
023    {
024        return new DERSet(_parser.readVector(), false);
025    }
026
027    public ASN1Primitive toASN1Primitive()
028    {
029        try
030        {
031            return getLoadedObject();
032        }
033        catch (IOException e)
034        {
035            throw new ASN1ParsingException(e.getMessage(), e);
036        }
037    }
038}