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();
}
}