Examples of XKMSInvoker


Examples of org.apache.cxf.xkms.client.XKMSInvoker

    public XkmsCryptoProvider(XKMSPortType xkmsConsumer, Crypto fallbackCrypto,
                              XKMSClientCache xkmsClientCache, boolean allowX509FromJKS) {
        if (xkmsConsumer == null) {
            throw new IllegalArgumentException("xkmsConsumer may not be null");
        }
        this.xkmsInvoker = new XKMSInvoker(xkmsConsumer);
        this.fallbackCrypto = fallbackCrypto;
        this.xkmsClientCache = xkmsClientCache;
        this.allowX509FromJKS = allowX509FromJKS;
    }
View Full Code Here

Examples of org.apache.cxf.xkms.client.XKMSInvoker

    public XkmsCryptoProvider(XKMSPortType xkmsConsumer, Crypto fallbackCrypto,
                              XKMSClientCache xkmsClientCache, boolean allowX509FromJKS) {
        if (xkmsConsumer == null) {
            throw new IllegalArgumentException("xkmsConsumer may not be null");
        }
        this.xkmsInvoker = new XKMSInvoker(xkmsConsumer);
        this.fallbackCrypto = fallbackCrypto;
        this.xkmsClientCache = xkmsClientCache;
        this.allowX509FromJKS = allowX509FromJKS;
    }
View Full Code Here

Examples of org.ejbca.core.protocol.xkms.client.XKMSInvoker

            if (((X509Certificate) trustedcerts[i]).getBasicConstraints() != -1) {
                trustcol.add(trustedcerts[i]);
            }
        }

        XKMSInvoker xKMSInvoker = new XKMSInvoker(SERVICE_URL, trustcol);

        // Test simple validate
        ValidateRequestType validateRequestType = xKMSObjectFactory.createValidateRequestType();
        validateRequestType.setId("200");

        UseKeyWithType useKeyWithType = xKMSObjectFactory.createUseKeyWithType();
        useKeyWithType.setApplication(XKMSConstants.USEKEYWITH_TLSHTTP);
        useKeyWithType.setIdentifier("Test");

        validateRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);

        QueryKeyBindingType queryKeyBindingType = xKMSObjectFactory.createQueryKeyBindingType();
        queryKeyBindingType.getUseKeyWith().add(useKeyWithType);
        validateRequestType.setQueryKeyBinding(queryKeyBindingType);

        JAXBElement<ValidateRequestType> validateRequest = xKMSObjectFactory.createValidateRequest(validateRequestType);

        Document doc = dbf.newDocumentBuilder().newDocument();
        marshaller.marshal(validateRequest, doc);
        try {
            ValidateResultType validateResultType = xKMSInvoker.validate(validateRequestType, pkCert, key);
            assertTrue(validateResultType.getRequestId().equals("200"));
            assertTrue(validateResultType.getResultMajor().equals(XKMSConstants.RESULTMAJOR_SUCCESS));
        } catch (javax.xml.ws.soap.SOAPFaultException e) {
            log.debug("", e);
            assertTrue("There was a server error. (" + e.getMessage() + ") Did you enable the XKMS CA service?", false);
View Full Code Here

Examples of org.ejbca.core.protocol.xkms.client.XKMSInvoker

            if (((X509Certificate) trustedcerts[i]).getBasicConstraints() != -1) {
                trustcol.add(trustedcerts[i]);
            }
        }

        XKMSInvoker xKMSInvoker = new XKMSInvoker(SERVICE_URL, trustcol);

        // Test simple validate
        ValidateRequestType validateRequestType = xKMSObjectFactory.createValidateRequestType();
        validateRequestType.setId("201");

        UseKeyWithType useKeyWithType = xKMSObjectFactory.createUseKeyWithType();
        useKeyWithType.setApplication(XKMSConstants.USEKEYWITH_TLSHTTP);
        useKeyWithType.setIdentifier("Test");

        validateRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);

        QueryKeyBindingType queryKeyBindingType = xKMSObjectFactory.createQueryKeyBindingType();
        queryKeyBindingType.getUseKeyWith().add(useKeyWithType);
        validateRequestType.setQueryKeyBinding(queryKeyBindingType);

        JAXBElement<ValidateRequestType> validateRequest = xKMSObjectFactory.createValidateRequest(validateRequestType);

        Document doc = dbf.newDocumentBuilder().newDocument();
        marshaller.marshal(validateRequest, doc);

        try {
            ValidateResultType validateResultType = xKMSInvoker.validate(validateRequestType, pkCert, key);
            assertTrue(validateResultType.getRequestId().equals("201"));
            assertTrue(validateResultType.getResultMajor().equals(XKMSConstants.RESULTMAJOR_SENDER));
            assertTrue(validateResultType.getResultMinor().equals(XKMSConstants.RESULTMINOR_NOAUTHENTICATION));
        } catch (javax.xml.ws.soap.SOAPFaultException e) {
            log.debug("", e);
View Full Code Here

Examples of org.ejbca.core.protocol.xkms.client.XKMSInvoker

            if (((X509Certificate) trustedcerts[i]).getBasicConstraints() != -1) {
                trustcol.add(trustedcerts[i]);
            }
        }

        XKMSInvoker xKMSInvoker = new XKMSInvoker(SERVICE_URL, trustcol);

        // Test simple validate
        ValidateRequestType validateRequestType = xKMSObjectFactory.createValidateRequestType();
        validateRequestType.setId("200");

        UseKeyWithType useKeyWithType = xKMSObjectFactory.createUseKeyWithType();
        useKeyWithType.setApplication(XKMSConstants.USEKEYWITH_TLSHTTP);
        useKeyWithType.setIdentifier("Test");

        validateRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);

        QueryKeyBindingType queryKeyBindingType = xKMSObjectFactory.createQueryKeyBindingType();
        queryKeyBindingType.getUseKeyWith().add(useKeyWithType);
        validateRequestType.setQueryKeyBinding(queryKeyBindingType);

        JAXBElement<ValidateRequestType> validateRequest = xKMSObjectFactory.createValidateRequest(validateRequestType);

        Document doc = dbf.newDocumentBuilder().newDocument();
        marshaller.marshal(validateRequest, doc);

        try {
            ValidateResultType validateResultType = xKMSInvoker.validate(validateRequestType, pkCert, key);
            assertTrue(validateResultType.getRequestId().equals("200"));
            assertTrue(validateResultType.getResultMajor().equals(XKMSConstants.RESULTMAJOR_SENDER));
            assertTrue(validateResultType.getResultMinor().equals(XKMSConstants.RESULTMINOR_NOAUTHENTICATION));
        } catch (javax.xml.ws.soap.SOAPFaultException e) {
            log.debug("", e);
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.