Package org.ejbca.core.model.ca.caadmin.extendedcaservices

Examples of org.ejbca.core.model.ca.caadmin.extendedcaservices.ExtendedCAServiceRequestException


    /* (non-Javadoc)
     * @see java.lang.Runnable#run()
     */
    public void run() {
        OCSPCAServiceResponse _result = null;
        ExtendedCAServiceRequestException _extendedCAServiceRequestException = null;
        IllegalExtendedCAServiceRequestException _illegalExtendedCAServiceRequestException = null;
        try {
            _result = this.se.sign(this.request);
        } catch (ExtendedCAServiceRequestException e) {
            _extendedCAServiceRequestException = e;
View Full Code Here


        }
        if ( this.extendedCAServiceRequestException!=null ) {
            throw this.extendedCAServiceRequestException;
        }
        if ( this.result==null ) {
            throw new ExtendedCAServiceRequestException("HSM has not responded within time limit. The timeout is set to "+HSM_TIMEOUT/1000+" seconds.");
        }
        return this.result;
    }
View Full Code Here

                    this.wait(HSM_DOWN_ANSWER_TIME); // Wait here to prevent the client repeat the request right away. Some CPU power might be needed to recover the HSM.
                } catch (InterruptedException e) {
                    throw new Error(e); //should never ever happen. The main thread should never be interrupted.
                }
            }
            throw new ExtendedCAServiceRequestException(hsmErrorString+". Waited "+HSM_DOWN_ANSWER_TIME/1000+" seconds to throw the exception");
        }
        final PrivateKey privKey;
        final X509Certificate entityCert;
        try {
            privKey = this.keyContainer.getKey();
            entityCert = this.keyContainer.getCertificate(); // must be after getKey
        } catch (ExtendedCAServiceRequestException e) {
            this.providerHandler.reload();
            throw e;
        } catch (Exception e) {
            this.providerHandler.reload();
            throw new ExtendedCAServiceRequestException(e);
        }
        if ( privKey==null ) {
            throw new ExtendedCAServiceRequestException(hsmErrorString);
        }
        try {
            return OCSPUtil.createOCSPCAServiceResponse(request, privKey, providerName, getCertificateChain(entityCert));
        } catch( ExtendedCAServiceRequestException e) {
            this.providerHandler.reload();
            throw e;
        } catch( IllegalExtendedCAServiceRequestException e ) {
            throw e;
        } catch( Throwable e ) {
            this.providerHandler.reload();
            final ExtendedCAServiceRequestException e1 = new ExtendedCAServiceRequestException(hsmErrorString);
            e1.initCause(e);
            throw e1;
        } finally {
            this.keyContainer.releaseKey();
        }
    }
View Full Code Here

        final BasicOCSPResp ocspresp = OCSPUtil.generateBasicOCSPResp(ocspServiceReq, sigAlg, signerCert, privKey, providerName, chain, respIdType);
        final OCSPCAServiceResponse result = new OCSPCAServiceResponse(ocspresp, Arrays.asList(chain));
        isCertificateValid(signerCert);
        return result;
      } catch (OCSPException ocspe) {
        throw new ExtendedCAServiceRequestException(ocspe);
      } catch (NoSuchProviderException nspe) {
        throw new ExtendedCAServiceRequestException(nspe);           
      } catch (NotSupportedException e) {
        m_log.info("OCSP Request type not supported: ", e);
        throw new IllegalExtendedCAServiceRequestException(e);
      } catch (IllegalArgumentException e) {
        m_log.error("IllegalArgumentException: ", e);
View Full Code Here

                List<X509Certificate> chain = Arrays.asList(signerChain);
                ocspServiceReq.setCertificateChain(chain);
                // Super class handles signing with the OCSP signing certificate
                log.debug("extendedService, with ca cert)");
              } catch (IllegalKeyStoreException ike) {
                throw new ExtendedCAServiceRequestException(ike);
              } catch (CATokenOfflineException ctoe) {
                throw new ExtendedCAServiceRequestException(ctoe);
              } catch (IllegalArgumentException e) {
                log.error("IllegalArgumentException: ", e);
                throw new IllegalExtendedCAServiceRequestException(e);
              }
              returnval = getExtendedCAService(ExtendedCAServiceInfo.TYPE_OCSPEXTENDEDSERVICE).extendedService(ocspServiceReq);           
View Full Code Here

TOP

Related Classes of org.ejbca.core.model.ca.caadmin.extendedcaservices.ExtendedCAServiceRequestException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.