ASN1Sequence seq = ASN1Sequence.getInstance((ASN1Sequence) new ASN1InputStream(new ByteArrayInputStream(oct.getOctets())).readObject());
ASN1Sequence seq = ASN1Sequence.getInstance(new ASN1InputStream(new ByteArrayInputStream(oct.getOctets())).readObject());
    protected BasicOCSPRespGenerator createOCSPResponse(OCSPReq req, X509Certificate cacert) throws OCSPException, NotSupportedException {        if (null == req) {            throw new IllegalArgumentException();        }        BasicOCSPRespGenerator res = new BasicOCSPRespGenerator(cacert.getPublicKey());        DERObjectIdentifier id_pkix_ocsp_nonce = new DERObjectIdentifier(OCSPObjectIdentifiers.pkix_ocsp + ".2");        DERObjectIdentifier id_pkix_ocsp_response = new DERObjectIdentifier(OCSPObjectIdentifiers.pkix_ocsp + ".4");        DERObjectIdentifier id_pkix_ocsp_basic = new DERObjectIdentifier(OCSPObjectIdentifiers.pkix_ocsp + ".1");        X509Extensions reqexts = req.getRequestExtensions();        if (reqexts != null) {            X509Extension ext = (X509Extension) reqexts.getExtension(id_pkix_ocsp_nonce);            if (null != ext) {                //m_log.debug("Found extension Nonce");                Hashtable table = new Hashtable();                table.put(id_pkix_ocsp_nonce, ext);                X509Extensions exts = new X509Extensions(table);                res.setResponseExtensions(exts);            }            ext = (X509Extension) reqexts.getExtension(id_pkix_ocsp_response);            if (null != ext) {                //m_log.debug("Found extension AcceptableResponses");                ASN1OctetString oct = ext.getValue();                try {                    ASN1Sequence seq = ASN1Sequence.getInstance((ASN1Sequence) new ASN1InputStream(new ByteArrayInputStream(oct.getOctets())).readObject());                    Enumeration en = seq.getObjects();                    boolean supportsResponseType = false;                    while (en.hasMoreElements()) {                        DERObjectIdentifier oid = (DERObjectIdentifier) en.nextElement();                        //m_log.debug("Found oid: "+oid.getId());                        if (oid.equals(id_pkix_ocsp_basic)) {                            // This is the response type we support, so we are happy! Break the loop.                            supportsResponseType = true;                            m_log.debug("Response type supported: " + oid.getId());                            continue;                        }                    }                    if (!supportsResponseType) {                        throw new NotSupportedException("Required response type not supported, this responder only supports id-pkix-ocsp-basic.");                    }                } catch (IOException e) {                }            }        }        return res;    }