Package org.ejbca.core.model.log

Examples of org.ejbca.core.model.log.Admin


        CryptoProviderTools.installBCProviderIfNotAvailable();
    }

    public void doRequest(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
     
      Admin admin = new Admin(Admin.TYPE_RA_USER);
     
      // SSL client authentication
      Object o = request.getAttribute("javax.servlet.request.X509Certificate");
      if (o == null || !(o instanceof X509Certificate[])) {
          throw new ServletException("This servlet requires certificate authentication!");
View Full Code Here


    final TcpReceivedMessage cmpTcpMessage = TcpReceivedMessage.getTcpMessage(command);
    if ( cmpTcpMessage.message==null )  {
      handler.closeConnection();
    } else {
      // We must use an administrator with rights to create users
      final Admin administrator = new Admin(Admin.TYPE_RA_USER, handler.getHostAddress());
      final IResponseMessage resp;
      try {
         resp = getEjb().getCmpMessageDispatcherSession().dispatch(administrator, cmpTcpMessage.message);
      } catch (IOException e) {
        LOG.error( INTRES.getLocalizedMessage("cmp.errornoasn1"), e );
View Full Code Here

    public ApprovalDataVO getApproveActionDataVO() {
        if (!initialized) {
            try {
                return new ApprovalDataVO(1, 1, ApprovalDataVO.APPROVALTYPE_DUMMY, 0, 0, "", "", ApprovalDataVO.STATUS_WAITINGFORAPPROVAL,
                        new ArrayList<Approval>(), new DummyApprovalRequest(
                                new Admin(CertTools.getCertfromByteArray(ApprovalDataVOView.dummycert), null, null), null,
                                ApprovalDataVO.ANY_ENDENTITYPROFILE, ApprovalDataVO.ANY_CA, false), new Date(), new Date(), 2);
            } catch (CertificateException e) {
                log.error(e);
            }
        }
View Full Code Here

        return retval;
    }
   
    private List<ApprovalDataText> getNewRequestDataAsText() {
      ApprovalRequest approvalRequest = data.getApprovalRequest();
      Admin admin = EjbcaJSFHelper.getBean().getAdmin();
      if (approvalRequest instanceof EditEndEntityApprovalRequest) {
        return ((EditEndEntityApprovalRequest)approvalRequest).getNewRequestDataAsText(admin, ejb.getCaAdminSession(),
            ejb.getEndEntityProfileSession(), ejb.getCertificateProfileSession(), ejb.getHardTokenSession());
      } else if (approvalRequest instanceof AddEndEntityApprovalRequest) {
        return ((AddEndEntityApprovalRequest)approvalRequest).getNewRequestDataAsText(admin, ejb.getCaAdminSession(),
View Full Code Here

      }
    }

    private List<ApprovalDataText> getOldRequestDataAsText() {
      ApprovalRequest approvalRequest = data.getApprovalRequest();
      Admin admin = EjbcaJSFHelper.getBean().getAdmin();
      if (approvalRequest instanceof EditEndEntityApprovalRequest) {
        return ((EditEndEntityApprovalRequest)approvalRequest).getOldRequestDataAsText(admin, ejb.getCaAdminSession(),
            ejb.getEndEntityProfileSession(), ejb.getCertificateProfileSession(), ejb.getHardTokenSession());
      } else {
        return approvalRequest.getOldRequestDataAsText(admin);
View Full Code Here

  }

  private void service(byte[] ba, String remoteAddr, HttpServletResponse response) throws IOException {
    try {
      // We must use an administrator with rights to create users
      final Admin administrator = new Admin(Admin.TYPE_RA_USER, remoteAddr);
      log.info( intres.getLocalizedMessage("cmp.receivedmsg", remoteAddr) );
      long startTime = System.currentTimeMillis();
      final IResponseMessage resp;
      try {
        resp = cmpMessageDispatcherLocal.dispatch(administrator, ba);
View Full Code Here

    CATokenManager.instance();
   
        // Load CAs at startup to improve impression of speed the first time a CA is accessed, it takes a little time to load it.
        log.trace(">init loading CAs into cache");
        try {
          Admin admin = new Admin(Admin.TYPE_CACOMMANDLINE_USER, "StartServicesServlet");
          caAdminSession.initializeAndUpgradeCAs(admin);
        } catch (Exception e) {
          log.error("Error creating CAAdminSession: ", e);
        }

        // Make a log row that EJBCA is starting
        Admin internalAdmin = Admin.getInternalAdmin();
        logSession.log(internalAdmin, internalAdmin.getCaId(), LogConstants.MODULE_SERVICES, new Date(), null, null,
            LogConstants.EVENT_INFO_STARTING, iMsg);

        log.trace(">init calling ServiceSession.load");
        try {
          serviceSession.load();
    } catch (Exception e) {
      log.error("Error init ServiceSession: ", e);
    }
   
        // Load Certificate profiles at startup to upgrade them if needed
        log.trace(">init loading CertificateProfile to check for upgrades");
        try {
          Admin admin = new Admin(Admin.TYPE_CACOMMANDLINE_USER, "StartServicesServlet");
          certificateProfileSession.initializeAndUpgradeProfiles(admin);
        } catch (Exception e) {
          log.error("Error creating CAAdminSession: ", e);
        }
       
        // Load EndEntity profiles at startup to upgrade them if needed
        // And add this node to list of nodes
        log.trace(">init loading EndEntityProfile to check for upgrades");
        try {
          Admin admin = new Admin(Admin.TYPE_CACOMMANDLINE_USER, "StartServicesServlet");
          endEntityProfileSession.initializeAndUpgradeProfiles(admin);
         
          // Add this node's hostname to list of nodes
            log.trace(">init checking if this node is in the list of nodes");
            final GlobalConfiguration config = globalConfigurationSession.getCachedGlobalConfiguration(admin);
View Full Code Here

      log.trace(">initialize()");
      if (!initialized) {
        if (request.getAttribute( "javax.servlet.request.X509Certificate" ) != null) {
          administrator = ejbcawebbean.getAdminObject();
        } else {
          administrator = new Admin(Admin.TYPE_PUBLIC_WEB_USER, request.getRemoteAddr());
        }
        this.informationmemory = ejbcawebbean.getInformationMemory();
        userAdminSession = ejb.getUserAdminSession();
        certificatesession = ejb.getCertificateStoreSession();
        authorizationsession = ejb.getAuthorizationSession();
View Full Code Here

        if (command == null) {
            command = "";
        }
        if (command.equalsIgnoreCase(COMMAND_CRL) && issuerdn != null) {
            try {
                Admin admin = ejbcawebbean.getAdminObject();
                byte[] crl = crlSession.getLastCRL(admin, issuerdn, false);
                X509CRL x509crl = CertTools.getCRLfromByteArray(crl);
                String dn = CertTools.getIssuerDN(x509crl);
            String basename = getBaseFileName(dn);
                String filename = basename+".crl";
                // We must remove cache headers for IE
                ServletUtils.removeCacheHeaders(res);
                res.setHeader("Content-disposition", "attachment; filename=" +  filename);
                res.setContentType("application/pkix-crl");
                res.setContentLength(crl.length);
                res.getOutputStream().write(crl);
                String iMsg = intres.getLocalizedMessage("certreq.sentlatestcrl", remoteAddr);
                log.info(iMsg);
            } catch (Exception e) {
                String errMsg = intres.getLocalizedMessage("certreq.errorsendcrl", remoteAddr, e.getMessage());
                log.error(errMsg, e);
                res.sendError(HttpServletResponse.SC_NOT_FOUND, errMsg);
                return;
            }
        }
        if (command.equalsIgnoreCase(COMMAND_DELTACRL) && issuerdn != null) {
          try {
            Admin admin = ejbcawebbean.getAdminObject();
            byte[] crl = crlSession.getLastCRL(admin, issuerdn, true);
            X509CRL x509crl = CertTools.getCRLfromByteArray(crl);
            String dn = CertTools.getIssuerDN(x509crl);
            String basename = getBaseFileName(dn);
            String filename = basename+"_delta.crl";
View Full Code Here

   * @param signedBy id of the signing CA
   * @return
   */
  public boolean createTestCA(String caName, int keyStrength, String dn, int signedBy, Collection certificateChain) {
        log.trace(">createTestCA");
        final Admin admin = new Admin(Admin.TYPE_CACOMMANDLINE_USER);
      try {
       this.adminGroupSession.init(admin, dn.hashCode(), DEFAULT_SUPERADMIN_CN);
    } catch (AdminGroupExistsException e) {
      log.error("",e);
    }
View Full Code Here

TOP

Related Classes of org.ejbca.core.model.log.Admin

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.