Package org.ejbca.core.protocol

Examples of org.ejbca.core.protocol.X509ResponseMessage


  protected void caCertResponse(EjbcaWSHelper ejbhelper, Admin admin, String caname, byte[] cert, List<byte[]> cachain, String keystorepwd)
    throws CADoesntExistsException, AuthorizationDeniedException, EjbcaException, ApprovalException, WaitingForApprovalException, CertPathValidatorException {
    try {
      CAInfo cainfo = caAdminSession.getCAInfo(admin, caname);
      // create response messages, for CVC certificates we use a regular X509ResponseMessage
      X509ResponseMessage msg = new X509ResponseMessage();
      msg.setCertificate(CertTools.getCertfromByteArray(cert));
      caAdminSession.receiveResponse(admin, cainfo.getCAId(), msg, cachain, keystorepwd);
    } catch (CertificateException e) {
            throw EjbcaWSHelper.getInternalException(e, null);
    }
  }
View Full Code Here


                        sequence = new String(ki);
                    }
                    cacertificate = signca.generateCertificate(cadata, publickey, -1, cainfo.getValidity(), certprofile, sequence);
                    // X509ResponseMessage works for both X509 CAs and CVC CAs
                    // here...pure luck? I don't think so!
                    returnval = new X509ResponseMessage();
                    returnval.setCertificate(cacertificate);

                    // Build Certificate Chain
                    Collection<Certificate> rootcachain = signca.getCertificateChain();
                    certchain = new ArrayList<Certificate>();
View Full Code Here

      } catch (IOException e) {
        log.debug("Input stream is not PEM certificate(s): "+e.getMessage());
        // See if it is a single binary certificate
        cert = CertTools.getCertfromByteArray(certbytes);
      }
      X509ResponseMessage resmes = new X509ResponseMessage();
      resmes.setCertificate(cert);
      if (StringUtils.equals(tokenAuthenticationCode, "null")) {
        // The value null can be converted to string "null" by the jsp layer
        tokenAuthenticationCode = null;
      }
      caadminsession.receiveResponse(administrator, caid, resmes, cachain, tokenAuthenticationCode);
View Full Code Here

          assertTrue("Was able to receiveResponse for a CA with a non X509ResponseMessage.", false);
        } catch (EjbcaException e) {
          // Expected
        }
        try {
          IResponseMessage resp = new X509ResponseMessage();
          resp.setCertificate(caAdminSession.getCAInfo(admin, "TEST").getCertificateChain().iterator().next());
            caAdminSession.receiveResponse(admin, "CN=TEST".hashCode(), resp, null, null);
          assertTrue("Was able to receiveResponse for a CA that is not 'signed by external'.", false);
        } catch (EjbcaException e) {
          // Expected
        }
View Full Code Here

TOP

Related Classes of org.ejbca.core.protocol.X509ResponseMessage

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.