Package org.ejbca.core.model.ca.caadmin.extendedcaservices

Examples of org.ejbca.core.model.ca.caadmin.extendedcaservices.CmsCAServiceRequest


    public void tearDown() throws Exception {
    }

    public void test01CmsCAServiceNotActive() throws Exception {
        CmsCAServiceRequest request = new CmsCAServiceRequest(doc, CmsCAServiceRequest.MODE_SIGN);
        // First try a request when the service is not active
        boolean active = true;
        try {
            caAdminSession.extendedService(admin, getTestCAId(), request);
        } catch (ExtendedCAServiceNotActiveException e) {
View Full Code Here


    }

    /**
   */
    public void test03CmsCAServiceActive() throws Exception {
        CmsCAServiceRequest request = new CmsCAServiceRequest(doc, CmsCAServiceRequest.MODE_SIGN);
        CmsCAServiceResponse resp = null;
        // Try the request again
        boolean active = true;
        try {
            resp = (CmsCAServiceResponse) caAdminSession.extendedService(admin, getTestCAId(), request);
View Full Code Here

    }

    /**
   */
    public void test03CmsCAEncryptDecrypt() throws Exception {
        CmsCAServiceRequest request = new CmsCAServiceRequest(doc, CmsCAServiceRequest.MODE_ENCRYPT);
        CmsCAServiceResponse resp = null;
        // Try the request again
        boolean active = true;
        try {
            resp = (CmsCAServiceResponse) caAdminSession.extendedService(admin, getTestCAId(), request);
        } catch (ExtendedCAServiceNotActiveException e) {
            active = false;
        }
        // By default the CA service is not active
        assertTrue(active);

        assertNotNull(resp);
        byte[] respdoc = resp.getCmsDocument();
        assertNotNull(respdoc);

        assertFalse(Arrays.equals(respdoc, doc));

        request = new CmsCAServiceRequest(respdoc, CmsCAServiceRequest.MODE_DECRYPT);

        // Try the request again
        active = true;
        try {
            resp = (CmsCAServiceResponse) caAdminSession.extendedService(admin, getTestCAId(), request);
View Full Code Here

      log.debug("Signing CA is '"+signingCA+"'");       
    }         
    if (ret!=null && StringUtils.isNotEmpty(signingCA)) {
      try {
        final int caid = Integer.parseInt(signingCA);
        final CmsCAServiceRequest request = new CmsCAServiceRequest(ret, CmsCAServiceRequest.MODE_SIGN);
        final CAAdminSession caAdminSession = new EjbLocalHelper().getCaAdminSession();
        final CmsCAServiceResponse resp = (CmsCAServiceResponse) caAdminSession.extendedService(admin, caid, request);
        ret = resp.getCmsDocument();
      } catch (IllegalExtendedCAServiceRequestException e) {
        log.error("Bad CA service", e);
View Full Code Here

TOP

Related Classes of org.ejbca.core.model.ca.caadmin.extendedcaservices.CmsCAServiceRequest

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.