Examples of UserDataVO


Examples of org.ejbca.core.model.ra.UserDataVO

                assertTrue("Allowing addition of identical approval requests.", false);
            }
            approveRevocation(internalAdmin, approvingAdmin, username, RevokedCertInfo.REVOCATION_REASON_UNSPECIFIED,
                    ApprovalDataVO.APPROVALTYPE_REVOKEENDENTITY, certificateStoreSession, approvalSessionRemote, approvalExecutionSessionRemote, approvalCAID);
            // Make sure userstatus changed to revoked
            UserDataVO userdata = userAdminSession.findUser(internalAdmin, username);
            assertTrue("User was not revoked when last cert was.", userdata.getStatus() == UserDataConstants.STATUS_REVOKED);
        } finally {
            userAdminSession.deleteUser(internalAdmin, username);
        }
    } // test02RevokeUser
View Full Code Here

Examples of org.ejbca.core.model.ra.UserDataVO

              getLogger().info("Usage: " + getCommand() + " <username>");
              getLogger().info(" A users certificate can unly be unrevoked if the revocation reason is certificate_hold.");
                return;
            }
            String username = args[1];
            UserDataVO data = ejb.getUserAdminSession().findUser(getAdmin(), username);
            getLogger().info("Found user:");
            getLogger().info("username=" + data.getUsername());
            getLogger().info("dn=\"" + data.getDN() + "\"");
            getLogger().info("Old status=" + data.getStatus());
            // Revoke users certificates
            try {
              boolean foundCertificateOnHold = false;
              // Find all user certs
              Iterator<Certificate> i = ejb.getCertStoreSession().findCertificatesByUsername(getAdmin(), username).iterator();
              while (i.hasNext()) {
                X509Certificate cert = (X509Certificate) i.next();
                if (ejb.getCertStoreSession().getStatus(cert.getIssuerDN().toString(),
                    cert.getSerialNumber()).revocationReason == RevokedCertInfo.REVOCATION_REASON_CERTIFICATEHOLD) {
                  foundCertificateOnHold = true;
                  try {
                    ejb.getUserAdminSession().revokeCert(getAdmin(), cert.getSerialNumber(), cert.getIssuerDN().toString(), RevokedCertInfo.NOT_REVOKED);
                        } catch (AlreadyRevokedException e) {
                          getLogger().error("The user was already reactivated while the request executed.");
                        } catch (ApprovalException e) {
                          getLogger().error("Reactivation already requested.");
                        } catch (WaitingForApprovalException e) {
                          getLogger().info("Reactivation request has been sent for approval.");
                  }
                }
              }
              if (!foundCertificateOnHold) {
                getLogger().error("No certificates with status 'On hold' were found for this user.");
              } else {
                  data = ejb.getUserAdminSession().findUser(getAdmin(), username);
                  getLogger().info("New status=" + data.getStatus());
              }
            } catch (AuthorizationDeniedException e) {
              getLogger().error("Not authorized to reactivate user.");
            }
        } catch (Exception e) {
View Full Code Here

Examples of org.ejbca.core.model.ra.UserDataVO

    }

    private void createUser(Admin admin, String username, int caID, int endEntityProfileId, int certProfileId) throws PersistenceException,
            AuthorizationDeniedException, UserDoesntFullfillEndEntityProfile, ApprovalException, WaitingForApprovalException, Exception {
        log.info("createUser: username=" + username + ", certProfileId=" + certProfileId);
        UserDataVO userdata = new UserDataVO(username, "CN=" + username, caID, null, null, 1, endEntityProfileId, certProfileId, SecConst.TOKEN_SOFT_P12, 0,
                null);
        userdata.setPassword("foo123");
        // userdata.setKeyRecoverable(true);
        createUser(admin, userdata);
    }
View Full Code Here

Examples of org.ejbca.core.model.ra.UserDataVO

        userAdminSession.addUser(admin, userdata, true);
        BatchMakeP12 makep12 = new BatchMakeP12();
        File tmpfile = File.createTempFile("ejbca", "p12");
        makep12.setMainStoreDir(tmpfile.getParent());
        makep12.createAllNew();
        UserDataVO userdata2 = userAdminSession.findUser(admin, userdata.getUsername());
        assertNotNull("findUser: " + userdata.getUsername(), userdata2);
        createdUsers.add(userdata.getUsername());
        log.info("created: " + userdata.getUsername());
    }
View Full Code Here

Examples of org.ejbca.core.model.ra.UserDataVO

    }

    private void changeUserDN(Admin admin, String username, String newDN) throws AuthorizationDeniedException,
            UserDoesntFullfillEndEntityProfile, ApprovalException, WaitingForApprovalException, Exception {

        UserDataVO userdata = userAdminSession.findUser(admin, username);
        assertNotNull(userdata);
        userdata.setDN(newDN);
        log.debug("changeUser: username=" + username + ", DN="+userdata.getDN()+", password="+userdata.getPassword()+", certProfileId=" + userdata.getCertificateProfileId());
        userAdminSession.changeUser(admin, userdata, true);
    }
View Full Code Here

Examples of org.ejbca.core.model.ra.UserDataVO

        userAdminSession.changeUser(admin, userdata, true);
    }

    private void changeUserCertProfile(Admin admin, String username, int newCertProfileId) throws AuthorizationDeniedException,
    UserDoesntFullfillEndEntityProfile, ApprovalException, WaitingForApprovalException, Exception {
        UserDataVO userdata = userAdminSession.findUser(admin, username);
        assertNotNull("findUser: " + username, userdata);
        userdata.setCertificateProfileId(newCertProfileId);
        userAdminSession.changeUser(admin, userdata, true);
    }
View Full Code Here

Examples of org.ejbca.core.model.ra.UserDataVO

        if (orgCert != null) {
            cert = orgCert;
            boolean finishUser = ejb.getCAAdminSession().getCAInfo(getAdmin(), caid).getFinishUser();
            if (finishUser) {
              UserDataVO userdata = ejb.getUserAdminSession().findUser(admin, username);
                ejb.getAuthenticationSession().finishUser(userdata);
            }

        } else {
            // Create self signed certificate, because ECDSA keys are not
View Full Code Here

Examples of org.ejbca.core.model.ra.UserDataVO

      if(resultMajor == null){
        if(resultMajor == null){
          X509Certificate cert = (X509Certificate) getPublicKeyInfo(req, false);
          boolean isCertValid = certIsValid(cert);
          if(isCertValid){           
            UserDataVO userData = findUserData(cert);
            String revocationCodeId = getRevocationCodeFromUserData(userData);
            if(userData != null && revocationCodeId != null){
              String revokeCode = getRevocationCode(req);
              if(XKMSConfig.isRevocationAllowed()){
                if(revokeCode != null ){
View Full Code Here

Examples of org.ejbca.core.model.ra.UserDataVO

      if(resultMajor == null){
        if(resultMajor == null){   // TODO: Bug??
          PublicKey publicKey = getPublicKey(req);         
          if(confirmPOP(publicKey)){
            String subjectDN = getSubjectDN(req);
            UserDataVO userData = findUserData(subjectDN);
            if(userData != null){
              String password = ""
              boolean encryptedPassword = isPasswordEncrypted(req);
              if(encryptedPassword){
                password = getEncryptedPassword(requestDoc, userData.getPassword());
              }else{
                password = getClearPassword(req, userData.getPassword());
              }
              String revocationCode = getRevocationCode(req);
              if(password != null ){
                X509Certificate cert = registerReissueOrRecover(false,false, result, userData,password, publicKey, revocationCode);
                if(cert != null){
View Full Code Here

Examples of org.ejbca.core.model.ra.UserDataVO

    ReissueResultType result = xkmsFactory.createReissueResultType();   
    super.populateResponse(result, requestVerifies);   
    ReissueRequestType req = (ReissueRequestType) this.req;
    // Variables defined here for debug reasons
    boolean isCertValid=false;
    UserDataVO userData = null;
    String password = "";
    X509Certificate newCert = null;
    if(resultMajor == null){    
      if(!checkValidRespondWithRequest(req.getRespondWith(),false)){
        resultMajor = XKMSConstants.RESULTMAJOR_SENDER;
        resultMinor = XKMSConstants.RESULTMINOR_MESSAGENOTSUPPORTED;
      }
      if(resultMajor == null){
        if(resultMajor == null){
          X509Certificate cert = (X509Certificate) getPublicKeyInfo(req, false);
          isCertValid = certIsValid(cert);
          if(isCertValid && confirmPOP(cert.getPublicKey())){           
            userData = findUserData(cert);
            if(userData != null){
              boolean encryptedPassword = isPasswordEncrypted(req);
              if(isCertValid && XKMSConfig.isAutomaticReissueAllowed()){
                password = setUserStatusToNew(userData);
              }else{             
                if(encryptedPassword){
                  password = getEncryptedPassword(requestDoc, userData.getPassword());
                }else{
                  password = getClearPassword(req, userData.getPassword());
                }
              }
              if(password != null ){
                newCert = registerReissueOrRecover(false,true, result, userData,password, cert.getPublicKey(), null);
                if(newCert != null){
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.