Package org.ejbca.ui.cli

Examples of org.ejbca.ui.cli.ErrorAdminCommandException


                } catch (AlreadyRevokedException e) {
                  getLogger().error("User is already revoked.");
                }
            }
        } catch (Exception e) {
            throw new ErrorAdminCommandException(e);
        }
    }
View Full Code Here


              getLogger().error("Given userdata doesn't fullfill profile.");
            } catch (FinderException e) {
              getLogger().error("User '"+username+"' does not exist.");
            }
        } catch (Exception e) {
            throw new ErrorAdminCommandException(e);
        }
    }
View Full Code Here

                String serNo = CertTools.getSerialNumberAsString(cert);
                getLogger().info("Certificate with subjectDN '" + subjectDN +
                    "' and serialNumber '" + serNo + "' expires at " + retDate + ".");
            }
        } catch (Exception e) {
            throw new ErrorAdminCommandException(e);
        }
    }
View Full Code Here

            getLogger().info("CAId for created CA: " + caid);
            getLogger().info("-Created and published initial CRL.");
            getLogger().info("CA initialized");
        } catch (Exception e) {
          getLogger().debug("An error occured: ", e);
            throw new ErrorAdminCommandException(e);
        }
    } // execute
View Full Code Here

        if (args.length == 1) {
          try{
            createCRL((String) null, false);
            getLogger().info("You can also run this command with \"" + getCommand() + " <caname> <-delta>\" to force CRL creation for a CA.");
          } catch (Exception e) {
            throw new ErrorAdminCommandException(e);
          }         
        } 
        if(args.length > 1){
            try {           
              String caname = args[1];
              boolean deltaCRL = false;
              if (args.length > 2) {
                if (StringUtils.equals(args[2], "-delta")) {
                  deltaCRL = true;
                }
              }
              CryptoProviderTools.installBCProvider();
              // createCRL prints info about crl generation
              String issuerName = getIssuerDN(caname);
              if (issuerName != null) {
                  createCRL(issuerName, deltaCRL);
              } else {
                getLogger().error("No such CA exists.");
              }
          } catch (Exception e) {
            throw new ErrorAdminCommandException(e);
          }
        } 
    }
View Full Code Here

              getLogger().error("Not authorized to change userdata.");
            } catch (UserDoesntFullfillEndEntityProfile e) {
              getLogger().error("Given userdata doesn't fullfill end entity profile. : " + e.getMessage());
            }
        } catch (Exception e) {
            throw new ErrorAdminCommandException(e);
        }
  }
View Full Code Here

            } catch (UserDoesntFullfillEndEntityProfile e) {
              getLogger().error("Given userdata doesn't fullfill end entity profile. : " +
                    e.getMessage());
            }
        } catch (Exception e) {
            throw new ErrorAdminCommandException(e);
        }
    }
View Full Code Here

            final String certserno = args[2];
            final BigInteger serno;
            try {
                serno = new BigInteger(certserno, 16);             
            } catch (NumberFormatException e) {
              throw new ErrorAdminCommandException("Invalid hexadecimal certificate serial number string: "+certserno);
            }
            int reason = Integer.parseInt(args[3]);
            if ((reason == 7) || (reason < 0) || (reason > 10)) {
              getLogger().error("Reason must be an integer between 0 and 10 except 7.");
            } else {
                Certificate cert = ejb.getCertStoreSession().findCertificateByIssuerAndSerno(getAdmin(), issuerDN, serno);
                if (cert != null) {
                    getLogger().info("Found certificate:");
                    getLogger().info("Subject DN=" + CertTools.getSubjectDN(cert));
                    // We need the user this cert is connected with
              // Revoke or unrevoke, will throw appropriate exceptions if parameters are wrong, such as trying to unrevoke a certificate
              // that was permanently revoked
              try {
                  ejb.getUserAdminSession().revokeCert(getAdmin(), serno, issuerDN, reason);
                        getLogger().info( (reason == 8 ? "Unrevoked":"Revoked") + " certificate with issuerDN '"+issuerDN+"' and serialNumber "+certserno+". Revocation reason="+reason);               
                    } catch (AlreadyRevokedException e) {
                      if (reason == 8) {
                            getLogger().info("Certificate with issuerDN '"+issuerDN+"' and serialNumber "+certserno+" is not revoked, nothing was done.");                       
                      } else {
                            getLogger().info("Certificate with issuerDN '"+issuerDN+"' and serialNumber "+certserno+" is already revoked, nothing was done.");
                      }
                        getLogger().info(e.getMessage());               
                    }
                } else {
                    getLogger().info("No certificate found with issuerDN '"+issuerDN+"' and serialNumber "+certserno);                     
                }
            }
        } catch (Exception e) {
            throw new ErrorAdminCommandException(e);
        }
    }
View Full Code Here

              getLogger().info(new String(CertTools.getPEMFromCerts(data)));
            } else {
              getLogger().info("User '" + username + "' does not exist.");
            }
        } catch (Exception e) {
            throw new ErrorAdminCommandException(e);
        }
    }
View Full Code Here

            getLogger().info("Key corresponding to users newest certificate has been marked for recovery.");            
        } else {
            getLogger().info("Failed to mark key corresponding to users newest certificate for recovery.");            
        }
      } catch (Exception e) {
        throw new ErrorAdminCommandException(e);
      }
    }
View Full Code Here

TOP

Related Classes of org.ejbca.ui.cli.ErrorAdminCommandException

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.