Examples of CADoesntExistsException


Examples of org.ejbca.core.model.ca.caadmin.CADoesntExistsException

 
  protected UserDataVO convertUserDataVOWS(Admin admin, UserDataVOWS userdata) throws CADoesntExistsException, EjbcaException, ClassCastException {
    final CAInfo cainfo = caAdminSession.getCAInfoOrThrowException(admin,userdata.getCaName());
    final int caid = cainfo.getCAId();
    if (caid == 0) {
      throw new CADoesntExistsException("Error CA " + userdata.getCaName() + " have caid 0, which is impossible.");
    }
   
    final int endentityprofileid = endEntityProfileSession.getEndEntityProfileId(admin,userdata.getEndEntityProfileName());
    if(endentityprofileid == 0){
      throw new EjbcaException(ErrorCode.EE_PROFILE_NOT_EXISTS,
View Full Code Here

Examples of org.ejbca.core.model.ca.caadmin.CADoesntExistsException

   * @return the found entity instance
   */
  public static CAData findByIdOrThrow(final EntityManager entityManager, final Integer cAId) throws CADoesntExistsException {
    final CAData ret = findById(entityManager, cAId);
    if (ret == null) {
      throw new CADoesntExistsException("CA id: " + cAId);
    }
    return ret;
  }
View Full Code Here

Examples of org.ejbca.core.model.ca.caadmin.CADoesntExistsException

   * @return the found entity instance
   */
  public static CAData findByNameOrThrow(final EntityManager entityManager, final String name) throws CADoesntExistsException {
    final CAData ret = findByName(entityManager, name);
    if (ret == null) {
      throw new CADoesntExistsException("CA name: " + name);
    }
    return ret;
  }
View Full Code Here

Examples of org.ejbca.core.model.ca.caadmin.CADoesntExistsException

        if (!authorizedToCA(admin, caid)) {
            if (log.isDebugEnabled()) {
                log.debug("Admin (" + admin.toString() + ") is not authorized to CA: " + caid);
            }
            String msg = intres.getLocalizedMessage("caadmin.canotexistsid", Integer.valueOf(caid));
            throw new CADoesntExistsException(msg);
        }
        return getCAInternal(caid, null);
    }
View Full Code Here

Examples of org.ejbca.core.model.ca.caadmin.CADoesntExistsException

        if (!authorizedToCA(admin, ca.getCAId())) {
            if (log.isDebugEnabled()) {
                log.debug("Admin (" + admin.toString() + ") is not authorized to CA with name: " + name);
            }
            String msg = intres.getLocalizedMessage("caadmin.canotexistsid", name);
            throw new CADoesntExistsException(msg);
        }
        return ca;
    }
View Full Code Here

Examples of org.ejbca.core.model.ca.caadmin.CADoesntExistsException

                    msg = intres.getLocalizedMessage("caadmin.canotexistsid", new Integer(caid));
                } else {
                    msg = intres.getLocalizedMessage("caadmin.canotexistsname", name);
                }
                log.info(msg);
                throw new CADoesntExistsException(msg);
            }
        }
        return cadata;
    }
View Full Code Here

Examples of org.ejbca.core.model.ca.caadmin.CADoesntExistsException

        if (!authorizedToCA(admin, caid)) {
            if (log.isDebugEnabled()) {
                log.debug("Admin (" + admin.toString() + ") is not authorized to CA: " + caid);
            }
            String msg = intres.getLocalizedMessage("caadmin.canotexistsid", Integer.valueOf(caid));
            throw new CADoesntExistsException(msg);
        }
        CAInfo cainfo = null;
        try {
            CA ca = caSession.getCA(admin, caid);      
            cainfo = ca.getCAInfo();
View Full Code Here

Examples of org.ejbca.core.model.ca.caadmin.CADoesntExistsException

            ret.create();
        } catch (IllegalKeyStoreException e) {
            throw new IllegalKeyException(e);
        } catch (NotFoundException e) {
          // This can actually not happen here?
            throw new CADoesntExistsException(e);
        } catch (NoSuchProviderException e) {
            log.error("NoSuchProvider provider: ", e);
        } catch (InvalidKeyException e) {
            log.error("Invalid key in request: ", e);
        } catch (NoSuchAlgorithmException e) {
View Full Code Here

Examples of org.ejbca.core.model.ca.caadmin.CADoesntExistsException

            log.error("No such algorithm: ", e);
        catch (CATokenOfflineException ctoe) {
          String msg = intres.getLocalizedMessage("error.catokenoffline", ca.getSubjectDN());
            log.error(msg, ctoe);
            logSession.log(admin, ca.getCAId(), LogConstants.MODULE_CA, new java.util.Date(), null, null, LogConstants.EVENT_ERROR_CREATECERTIFICATE, msg, ctoe);
            throw new CADoesntExistsException(msg);
        }
        log.trace("<decryptAndVerifyRequest(IRequestMessage)");
        return req;
    }
View Full Code Here

Examples of org.ejbca.core.model.ca.caadmin.CADoesntExistsException

            ret.create();
            // TODO: handle returning errors as response message,
            // javax.ejb.ObjectNotFoundException and the others thrown...
        } catch (NotFoundException e) {
          // This actually can not happen here
            throw new CADoesntExistsException(e);
        } catch (IllegalKeyStoreException e) {
            throw new IllegalKeyException(e);
        } catch (NoSuchProviderException e) {
            log.error("NoSuchProvider provider: ", e);
        } catch (InvalidKeyException e) {
            log.error("Invalid key in request: ", e);
        } catch (NoSuchAlgorithmException e) {
            log.error("No such algorithm: ", e);
        } catch (CRLException e) {
            log.error("Cannot create response message: ", e);
        } catch (IOException e) {
            log.error("Cannot create response message: ", e);
        } catch (CATokenOfflineException ctoe) {
          String msg = intres.getLocalizedMessage("error.catokenoffline", ca.getSubjectDN());
          log.error(msg, ctoe);
            logSession.log(admin, ca.getCAId(), LogConstants.MODULE_CA, new java.util.Date(), null, null, LogConstants.EVENT_ERROR_GETLASTCRL, msg, ctoe);
            throw new CADoesntExistsException(msg);
        }
        log.trace("<getCRL(IRequestMessage)");
        return ret;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.