Package org.ejbca.core.model.log

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


  public List<Certificate> cvcRequest(String username, String password, String cvcreq)
      throws CADoesntExistsException, AuthorizationDeniedException, UserDoesntFullfillEndEntityProfile, NotFoundException,
      EjbcaException, ApprovalException, WaitingForApprovalException, SignRequestException, CertificateExpiredException {
    log.trace(">cvcRequest");
    EjbcaWSHelper ejbhelper = new EjbcaWSHelper(wsContext, authorizationSession, caAdminSession, certificateProfileSession, certificateStoreSession, endEntityProfileSession, hardTokenSession, userAdminSession);
    Admin admin = ejbhelper.getAdmin();

    // If password is empty we can generate a big random one to use instead
    if (StringUtils.isEmpty(password)) {
      AllPrintableCharPasswordGenerator gen = new AllPrintableCharPasswordGenerator();
      password = gen.getNewPassword(15, 20);
View Full Code Here


    if (log.isTraceEnabled()) {
      log.trace(">caRenewCertRequest");     
    }
    log.debug("Create certificate request for CA "+caname+", regeneratekeys="+regenerateKeys+", usenextkey="+usenextkey+", activatekey="+activatekey+", keystorepwd: "+(keystorepwd==null?"null":"hidden"));
    EjbcaWSHelper ejbhelper = new EjbcaWSHelper(wsContext, authorizationSession, caAdminSession, certificateProfileSession, certificateStoreSession, endEntityProfileSession, hardTokenSession, userAdminSession);
    Admin admin = ejbhelper.getAdmin();
    byte[] ret = null;
    try {
      ret = ejbhelper.caRenewCertRequest(ejbhelper, admin, caname, cachain, regenerateKeys, usenextkey, activatekey, keystorepwd);
    } catch (CertPathValidatorException e) {
        throw EjbcaWSHelper.getEjbcaException(e, null, ErrorCode.CERT_PATH_INVALID, Level.DEBUG);
View Full Code Here

   */
  public void caCertResponse(String caname, byte[] cert, List<byte[]> cachain, String keystorepwd) throws CADoesntExistsException, AuthorizationDeniedException, EjbcaException, ApprovalException, WaitingForApprovalException {
    log.trace(">caCertResponse");
    log.info("Import certificate response for CA "+caname+", keystorepwd: "+(keystorepwd==null?"null":"hidden"));
    EjbcaWSHelper ejbhelper = new EjbcaWSHelper(wsContext, authorizationSession, caAdminSession, certificateProfileSession, certificateStoreSession, endEntityProfileSession, hardTokenSession, userAdminSession);
    Admin admin = ejbhelper.getAdmin();
    try {
      ejbhelper.caCertResponse(ejbhelper, admin, caname, cert, cachain, keystorepwd);     
    } catch (CertPathValidatorException e) {
        throw EjbcaWSHelper.getEjbcaException(e, null, ErrorCode.CERT_PATH_INVALID, Level.DEBUG);
    } catch (CATokenOfflineException e) {
View Full Code Here

  private byte[] processCertReq(final String username, final String password, final String req, final int reqType,
      final String hardTokenSN, final String responseType, final IPatternLogger logger) throws EjbcaException, AuthorizationDeniedException {
    byte[] retval = null;
    try {
      final EjbcaWSHelper ejbhelper = new EjbcaWSHelper(wsContext, authorizationSession, caAdminSession, certificateProfileSession, certificateStoreSession, endEntityProfileSession, hardTokenSession, userAdminSession);
      final Admin admin = ejbhelper.getAdmin();       
            logAdminName(admin,logger);
      // check authorization to CAID
      final UserDataVO userdata = userAdminSession.findUser(admin, username);
      if (userdata == null) {
        throw new NotFoundException(intres.getLocalizedMessage("ra.errorentitynotexist", username));
View Full Code Here

    throws CADoesntExistsException, AuthorizationDeniedException, NotFoundException, EjbcaException {
   
        final IPatternLogger logger = TransactionLogger.getPatternLogger();
        try{
        EjbcaWSHelper ejbhelper = new EjbcaWSHelper(wsContext, authorizationSession, caAdminSession, certificateProfileSession, certificateStoreSession, endEntityProfileSession, hardTokenSession, userAdminSession);
        Admin admin = ejbhelper.getAdmin();
              logAdminName(admin,logger);

        // check CAID
        UserDataVO userdata = userAdminSession.findUser(admin,username);
        if(userdata == null){
View Full Code Here

          log.debug("Revoke cert with serial number '"+certificateSN+"' from issuer '"+issuerDN+"' with reason '"+reason+"'.");
    }
        final IPatternLogger logger = TransactionLogger.getPatternLogger();
        try {
      final EjbcaWSHelper ejbhelper = new EjbcaWSHelper(wsContext, authorizationSession, caAdminSession, certificateProfileSession, certificateStoreSession, endEntityProfileSession, hardTokenSession, userAdminSession);
      final Admin admin = ejbhelper.getAdmin();
            logAdminName(admin,logger);
      final int caid = CertTools.stringToBCDNString(issuerDN).hashCode();
      caAdminSession.verifyExistenceOfCA(caid);
      final BigInteger serno = new BigInteger(certificateSN, 16);
      // Revoke or unrevoke, will throw appropriate exceptions if parameters are wrong, such as trying to unrevoke a certificate
View Full Code Here

      throws CADoesntExistsException, AuthorizationDeniedException, NotFoundException, AlreadyRevokedException, EjbcaException, ApprovalException, WaitingForApprovalException {

        final IPatternLogger logger = TransactionLogger.getPatternLogger();
        try{
      EjbcaWSHelper ejbhelper = new EjbcaWSHelper(wsContext, authorizationSession, caAdminSession, certificateProfileSession, certificateStoreSession, endEntityProfileSession, hardTokenSession, userAdminSession);
      Admin admin = ejbhelper.getAdmin();
            logAdminName(admin,logger);

      // check username
      UserDataVO userdata = userAdminSession.findUser(admin,username);
      if(userdata == null){
View Full Code Here

  public void keyRecoverNewest(String username) throws CADoesntExistsException, AuthorizationDeniedException, NotFoundException, EjbcaException, ApprovalException, WaitingForApprovalException {
    log.trace(">keyRecoverNewest");
        final IPatternLogger logger = TransactionLogger.getPatternLogger();
        try{
      EjbcaWSHelper ejbhelper = new EjbcaWSHelper(wsContext, authorizationSession, caAdminSession, certificateProfileSession, certificateStoreSession, endEntityProfileSession, hardTokenSession, userAdminSession);
      Admin admin = ejbhelper.getAdmin();
            logAdminName(admin,logger);

            boolean usekeyrecovery = globalConfigurationSession.getCachedGlobalConfiguration(admin).getEnableKeyRecovery()
            if(!usekeyrecovery){
        throw EjbcaWSHelper.getEjbcaException("Keyrecovery have to be enabled in the system configuration in order to use this command.",
View Full Code Here

  public RevokeStatus checkRevokationStatus(String issuerDN, String certificateSN) throws CADoesntExistsException, AuthorizationDeniedException, EjbcaException {
        final IPatternLogger logger = TransactionLogger.getPatternLogger();

    try{
      EjbcaWSHelper ejbhelper = new EjbcaWSHelper(wsContext, authorizationSession, caAdminSession, certificateProfileSession, certificateStoreSession, endEntityProfileSession, hardTokenSession, userAdminSession);
      Admin admin = ejbhelper.getAdmin();     
          logAdminName(admin,logger);

      // check that admin is autorized to CA
      int caid = CertTools.stringToBCDNString(issuerDN).hashCode();
      caAdminSession.verifyExistenceOfCA(caid);
View Full Code Here

  @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
  public boolean isAuthorized(String resource) throws EjbcaException{
        final IPatternLogger logger = TransactionLogger.getPatternLogger();
    try {
      final EjbcaWSHelper ejbhelper = new EjbcaWSHelper(wsContext, authorizationSession, caAdminSession, certificateProfileSession, certificateStoreSession, endEntityProfileSession, hardTokenSession, userAdminSession);
            final Admin admin = ejbhelper.getAdmin();
            logAdminName(admin,logger);
      return authorizationSession.isAuthorized(admin, resource)
    } catch (AuthorizationDeniedException ade) {
            return false;
        } catch (RuntimeException e) {  // EJBException, ClassCastException, ...
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.