Package org.ejbca.extra.db

Examples of org.ejbca.extra.db.CertificateRequestRequest


  /**
   * @see org.ejbca.externalra.gui.IRequestDispatcher#getCertificateSigningRequestResponse(java.lang.String, java.lang.String, java.lang.String, int)
   */
  public ResponseData getCertificateSigningRequestResponse(String username, String password, String certificateRequest, int responseType) {
    ResponseData csrResponse = null;
    CertificateRequestResponse responseSub = (CertificateRequestResponse) getResponseFromCA(new CertificateRequestRequest(
        random.nextLong(), username, password, CertificateRequestRequest.REQUEST_TYPE_PKCS10, certificateRequest.getBytes(), responseType));
    if (responseSub != null) {
      if (responseSub.isSuccessful()) {
        csrResponse = new ResponseData(responseSub.getResponseData(), responseSub.getResponseType(), null);
      } else {
View Full Code Here


  /**
   * @see org.ejbca.externalra.gui.IRequestDispatcher#getCertificateResponse(java.lang.String, java.lang.String, int, byte[], int)
   */
  public ResponseData getCertificateResponse(String username, String password, int requestType, byte[] buf, int responseType) {
    ResponseData certificateResponse = null;
    CertificateRequestResponse responseSub = (CertificateRequestResponse) getResponseFromCA(new CertificateRequestRequest(
        random.nextLong(), username, password, requestType, buf, responseType));
    if (responseSub != null) {
      if (responseSub.isSuccessful()) {
        certificateResponse = new ResponseData(responseSub.getResponseData(), responseSub.getResponseType(), null);
      } else {
View Full Code Here

    assertTrue("Wrong Request ID" + resp.getRequestId(), resp.getRequestId() == requestId);
    assertTrue("Edit user failed", resp.isSuccessful() == true);
    // Try to retrieve keystore
    requestId = random.nextLong();
    byte[] requestData = NonEjbTestTools.generatePKCS10Req("CN=dummyname", password);
    CertificateRequestRequest certificateRequestRequest = new CertificateRequestRequest(requestId, username, password, CertificateRequestRequest.REQUEST_TYPE_PKCS10, requestData, CertificateRequestRequest.RESPONSE_TYPE_ENCODED);
    smgs = new SubMessages(null,null,null);
    smgs.addSubMessage(certificateRequestRequest);
    msghome.create(username+"csr", smgs);
        msg = waitForUser(username+"csr");
    assertNotNull("No response.", msg);
View Full Code Here

    final byte[] requestData = new String("-----BEGIN CERTIFICATE REQUEST-----\n"
        + new String(Base64.encode(new PKCS10CertificationRequest("SHA1WithRSA",
                    CertTools.stringToBcX509Name("CN=oneshot-dummyname"), keys.getPublic(), null, keys.getPrivate()).getEncoded()))
        + "\n-----END CERTIFICATE REQUEST-----").getBytes();
   
    final CertificateRequestRequest request = new CertificateRequestRequest(
        requestId,
        username,
        "CN=" + username,
        null,
        null,
        null,
        "EMPTY",
        "ENDUSER",
        "AdminCA1",
        null,
        password,
        CertificateRequestRequest.REQUEST_TYPE_PKCS10, requestData, CertificateRequestRequest.RESPONSE_TYPE_CERTIFICATE);
    request.setCreateOrEditUser(true);
   
    final SubMessages smgs = new SubMessages(null,null,null);
    smgs.addSubMessage(request);
    msghome.create(username + "csr", smgs);
       
View Full Code Here

TOP

Related Classes of org.ejbca.extra.db.CertificateRequestRequest

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.