Examples of IResponseMessage


Examples of org.ejbca.core.protocol.IResponseMessage

        SecConst.TOKEN_SOFT_BROWSERGEN, 0, null);
    user.setPassword("foo123");
    ExtendedInformation ei = new ExtendedInformation();
    ei.setCertificateSerialNumber(serno);
    user.setExtendedinformation(ei);
    IResponseMessage resp = certificateRequestSession.processCertReq(admin, user, p10, org.ejbca.core.protocol.X509ResponseMessage.class);

    X509Certificate cert = (X509Certificate) CertTools.getCertfromByteArray(resp.getResponseMessage());
    assertNotNull("Failed to create certificate", cert);
    log.debug("Cert=" + cert.toString());
    log.debug("foo certificate serialnumber: " + cert.getSerialNumber());
    assertTrue(cert.getSerialNumber().compareTo(serno) == 0);
View Full Code Here

Examples of org.ejbca.core.protocol.IResponseMessage

    UserDataVO user = new UserDataVO("foo2", "C=SE,O=AnaTom,CN=foo2", rsacaid, null, "foo@anatom.se", SecConst.USER_ENDUSER, fooEEProfileId, fooCertProfileId,
        SecConst.TOKEN_SOFT_BROWSERGEN, 0, null);
    user.setPassword("foo123");


    IResponseMessage resp = certificateRequestSession.processCertReq(admin, user, p10, org.ejbca.core.protocol.X509ResponseMessage.class);

    X509Certificate cert = (X509Certificate) CertTools.getCertfromByteArray(resp.getResponseMessage());
    assertNotNull("Failed to create certificate", cert);
    log.debug("Cert=" + cert.toString());
    log.debug("foo2 certificate serialnumber: " + cert.getSerialNumber());
    assertTrue(cert.getSerialNumber().compareTo(serno) != 0);
View Full Code Here

Examples of org.ejbca.core.protocol.IResponseMessage

    user.setPassword("foo123");
    ExtendedInformation ei = new ExtendedInformation();
    ei.setCertificateSerialNumber(serno);
    user.setExtendedinformation(ei);

    IResponseMessage resp = null;
    try {
      resp = certificateRequestSession.processCertReq(admin, user, p10, org.ejbca.core.protocol.X509ResponseMessage.class);
    } catch (EjbcaException e) {
      log.debug(e.getMessage());
      assertTrue("Unexpected exception.", e.getMessage().startsWith("There is already a certificate stored in 'CertificateData' with the serial number"));
View Full Code Here

Examples of org.ejbca.core.protocol.IResponseMessage

            PKCS10RequestMessage msg = new PKCS10RequestMessage(request);
            assertEquals("CN=TESTSIGNEDBYEXTERNAL", msg.getRequestDN());

            // Receive the certificate request on the TEST CA
            info.setSignedBy("CN=TEST".hashCode());
            IResponseMessage resp = caAdminSession.processRequest(admin, info, msg);

            // Receive the signed certificate back on our SubCA
            caAdminSession.receiveResponse(admin, info.getCAId(), resp, null, null);

            // Check that the CA has the correct certificate chain now
View Full Code Here

Examples of org.ejbca.core.protocol.IResponseMessage

          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

Examples of org.ejbca.core.protocol.IResponseMessage

        log.debug("CertificationRequest generated successfully.");
        byte[] bcp10 = bOut.toByteArray();
        PKCS10RequestMessage p10 = new PKCS10RequestMessage(bcp10);
        p10.setUsername("foo");
        p10.setPassword("foo123");
        IResponseMessage resp = signSession.createCertificate(admin, p10, org.ejbca.core.protocol.X509ResponseMessage.class, null);
        Certificate cert = CertTools.getCertfromByteArray(resp.getResponseMessage());
        assertNotNull("Failed to create certificate", cert);
        log.debug("Cert=" + cert.toString());

        // Verify error handling
        UserDataVO badUserData = new UserDataVO();
View Full Code Here

Examples of org.ejbca.core.protocol.IResponseMessage

        log.debug("Reset status of 'foo' to NEW");

        PKCS10RequestMessage p10 = new PKCS10RequestMessage(keytoolp10);
        p10.setUsername("foo");
        p10.setPassword("foo123");
        IResponseMessage resp = signSession.createCertificate(admin, p10, org.ejbca.core.protocol.X509ResponseMessage.class, null);
        Certificate cert = CertTools.getCertfromByteArray(resp.getResponseMessage());
        assertNotNull("Failed to create certificate", cert);
        log.debug("Cert=" + cert.toString());
        log.trace("<test04TestKeytoolPKCS10()");
    }
View Full Code Here

Examples of org.ejbca.core.protocol.IResponseMessage

        log.debug("Reset status of 'foo' to NEW");

        PKCS10RequestMessage p10 = new PKCS10RequestMessage(iep10);
        p10.setUsername("foo");
        p10.setPassword("foo123");
        IResponseMessage resp = signSession.createCertificate(admin, p10, org.ejbca.core.protocol.X509ResponseMessage.class, null);
        Certificate cert = CertTools.getCertfromByteArray(resp.getResponseMessage());
        assertNotNull("Failed to create certificate", cert);
        log.debug("Cert=" + cert.toString());
        log.trace("<test05TestIEPKCS10()");
    }
View Full Code Here

Examples of org.ejbca.core.protocol.IResponseMessage

        try {
            PKCS10RequestMessage p10 = new PKCS10RequestMessage(keytooldsa);
            p10.setUsername("foo");
            p10.setPassword("foo123");
            IResponseMessage resp = signSession.createCertificate(admin, p10, org.ejbca.core.protocol.X509ResponseMessage.class, null);
            Certificate cert = CertTools.getCertfromByteArray(resp.getResponseMessage());
            log.info("cert with DN '" + CertTools.getSubjectDN(cert) + "' should not be issued?");
        } catch (Exception e) {
            // RSASignSession should throw an IllegalKeyException here.
            assertTrue("Expected IllegalKeyException: " + e.toString(), e instanceof IllegalKeyException);
        }
View Full Code Here

Examples of org.ejbca.core.protocol.IResponseMessage

        log.debug("CertificationRequest generated successfully.");
        byte[] bcp10 = bOut.toByteArray();
        PKCS10RequestMessage p10 = new PKCS10RequestMessage(bcp10);
        p10.setUsername("foo");
        p10.setPassword("foo123");
        IResponseMessage resp = signSession.createCertificate(admin, p10, org.ejbca.core.protocol.X509ResponseMessage.class, null);
        Certificate cert = CertTools.getCertfromByteArray(resp.getResponseMessage());
        assertNotNull("Failed to create certificate", cert);
        log.debug("Cert=" + cert.toString());
        PublicKey pk = cert.getPublicKey();
        if (pk instanceof JCEECPublicKey) {
            JCEECPublicKey ecpk = (JCEECPublicKey) pk;
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.