}
if (ret!=null && StringUtils.isNotEmpty(signingCA)) {
try {
final int caid = Integer.parseInt(signingCA);
final CmsCAServiceRequest request = new CmsCAServiceRequest(ret, CmsCAServiceRequest.MODE_SIGN);
final CAAdminSession caAdminSession = new EjbLocalHelper().getCaAdminSession();
final CmsCAServiceResponse resp = (CmsCAServiceResponse) caAdminSession.extendedService(admin, caid, request);
ret = resp.getCmsDocument();
} catch (IllegalExtendedCAServiceRequestException e) {
log.error("Bad CA service", e);
} catch (CADoesntExistsException e) {
log.error("Bad CA", e);