Package org.ejbca.core.model.log

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


   *
   * @param remoteAddress The remote address as supplied by the request JSP object.
   */
  public void initialize(String remoteAddress) {
    log.trace(">initialize()");
      mAdmin = new Admin(Admin.TYPE_PUBLIC_WEB_USER, remoteAddress);
      mInitialized = true;
  }
View Full Code Here


    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException {
        final ServletDebug debug = new ServletDebug(request, response);
        boolean usekeyrecovery = false;
        try {
            Admin administrator = new Admin(Admin.TYPE_RA_USER);
            final String username; {
                Object o = request.getAttribute("javax.servlet.request.X509Certificate");
                final X509Certificate[] certs;
                if ( o!=null && o instanceof X509Certificate[] ) {
                    certs = (X509Certificate[])o;
View Full Code Here

    private UserAdminSessionRemote userAdminSession = InterfaceCache.getUserAdminSession();
    private CAAdminSessionRemote caAdminSession = InterfaceCache.getCAAdminSession();

    public CrmfRAPbeMultipleKeyIdRequestTest(String arg0) throws CertificateEncodingException, CertificateException {
        super(arg0);
        admin = new Admin(Admin.TYPE_BATCHCOMMANDLINE_USER);
        CryptoProviderTools.installBCProvider();
        // Try to get caIds
        CAInfo adminca1 = caAdminSession.getCAInfo(admin, "CmpCA1");
        caid1 = adminca1.getCAId();
        CAInfo adminca2 = caAdminSession.getCAInfo(admin, "CmpCA2");
View Full Code Here

      }
      if (keyalgstring != null) {
        keyalg = keyalgstring;
      }

      Admin administrator = new Admin(Admin.TYPE_PUBLIC_WEB_USER, request.getRemoteAddr());

      RequestHelper helper = new RequestHelper(administrator, debug);

      log.info(intres.getLocalizedMessage("certreq.receivedcertreq", username, request.getRemoteAddr()));
      debug.print("Username: " + username);

      // Check user
      int tokentype = SecConst.TOKEN_SOFT_BROWSERGEN;

      usekeyrecovery = globalConfigurationSession.getCachedGlobalConfiguration(administrator).getEnableKeyRecovery();

      UserDataVO data = userAdminSession.findUser(administrator, username);

      if (data == null) {
        throw new ObjectNotFoundException();
      }

      boolean savekeys = data.getKeyRecoverable() && usekeyrecovery &&  (data.getStatus() != UserDataConstants.STATUS_KEYRECOVERY);
      boolean loadkeys = (data.getStatus() == UserDataConstants.STATUS_KEYRECOVERY) && usekeyrecovery;

      int endEntityProfileId = data.getEndEntityProfileId();
      int certificateProfileId = data.getCertificateProfileId();
      EndEntityProfile endEntityProfile = endEntityProfileSession.getEndEntityProfile(administrator, endEntityProfileId);
      boolean reusecertificate = endEntityProfile.getReUseKeyRecoveredCertificate();
      // Set a new certificate profile, if we have requested one specific
      if (StringUtils.isNotEmpty(certprofile)) {
        boolean clearpwd = StringUtils.isNotEmpty(data.getPassword());
        int id = certificateProfileSession.getCertificateProfileId(administrator, certprofile);
        // Change the value if there exists a certprofile with the requested name, and it is not the same as
        // the one already registered to be used by default
        if ( (id > 0) ) {
          if (id != certificateProfileId) {
            // Check if it is in allowed profiles in the entity profile
            Collection c = endEntityProfile.getAvailableCertificateProfileIds();
            if (c.contains(String.valueOf(id))) {
              data.setCertificateProfileId(id);
              // This admin can be the public web user, which may not be allowed to change status,
              // this is a bit ugly, but what can a man do...
              Admin tempadmin = Admin.getInternalAdmin();
              userAdminSession.changeUser(tempadmin, data, clearpwd);                                 
            } else {
              String defaultCertificateProfileName = certificateProfileSession.getCertificateProfileName(administrator, certificateProfileId);
              log.info(intres.getLocalizedMessage("certreq.badcertprofile", certprofile, defaultCertificateProfileName));
            }
View Full Code Here

    private CertificateProfileSession certProfileSession = InterfaceCache.getCertificateProfileSession();

    public CrmfRARequestCustomSerialNoTest(String arg0) throws CertificateEncodingException, CertificateException {
        super(arg0);

        admin = new Admin(Admin.TYPE_BATCHCOMMANDLINE_USER);
        // Configure CMP for this test, we allow custom certificate serial numbers
      CertificateProfile profile = new EndUserCertificateProfile();
      //profile.setAllowCertSerialNumberOverride(true);
      try {
        certProfileSession.addCertificateProfile(admin, "CMPTESTPROFILE", profile);
View Full Code Here

            if (nextAlias.equals("wsnonadmintest")) {
                reqadmincert = (X509Certificate) ks.getCertificate(nextAlias);
            }
        }

        admin1 = new Admin(admincert1, adminusername1, null);
        reqadmin = userAdminSession.getAdmin(reqadmincert);
    }
View Full Code Here

            certificateProfileSessionRemote.removeCertificateProfile(admin, CERTIFICATE_PROFILE_NAME);
        }
    }

    public void setUp() throws Exception {
        admin = new Admin(Admin.TYPE_CACOMMANDLINE_USER);
        caInitCommand = new CaInitCommand();
        if (caAdminSession.getCAInfo(admin, CA_NAME) != null) {
            caSession.removeCA(admin, caInitCommand.getCAInfo(CA_NAME).getCAId());
        }
    }
View Full Code Here

        X509Certificate[] certs = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate");
        if (certs == null) {
            throw new ServletException("This servlet requires certificate authentication!");
        }
       
        Admin admin = userAdminSession.getAdmin(certs[0]);
       
        RequestHelper.setDefaultCharacterEncoding(request);

        byte[] buffer = pkcs10Bytes(request.getParameter("pkcs10req"));
        if (buffer == null) {
View Full Code Here

  
    public String approve() {
      final Approval approval = new Approval(comment);
      try {      
        final Admin admin = EjbcaJSFHelper.getBean().getAdmin();
        ejb.getApprovalExecutionSession().approve(admin, approveRequestData.getApprovalId(), approval, ejb.getGlobalConfigurationSession().getCachedGlobalConfiguration(admin));
        updateApprovalRequestData(approveRequestData.getApproveActionDataVO().getId());
      } catch (ApprovalRequestExpiredException e) {
        addErrorMessage("APPROVALREQUESTEXPIRED");
      } catch (ApprovalRequestExecutionException e) {
View Full Code Here

    }

    public String reject(){
      final Approval approval = new Approval(comment);
      try {
        final Admin admin = EjbcaJSFHelper.getBean().getAdmin();
        ejb.getApprovalSession().reject(admin,  approveRequestData.getApprovalId(), approval, ejb.getGlobalConfigurationSession().getCachedGlobalConfiguration(admin));
        updateApprovalRequestData(approveRequestData.getApproveActionDataVO().getId());
      } catch (ApprovalRequestExpiredException e) {
        addErrorMessage("APPROVALREQUESTEXPIRED");
      } catch (AuthorizationDeniedException 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.