Package org.apache.cxf.xkms.model.xkms

Examples of org.apache.cxf.xkms.model.xkms.LocateResultType


    }

    public X509Certificate getCertificate(List<X509AppId> ids) {
        try {
            LocateRequestType locateRequestType = prepareLocateXKMSRequest(ids);
            LocateResultType locateResultType = xkmsConsumer.locate(locateRequestType);
            return parseLocateXKMSResponse(locateResultType, ids);
        } catch (RuntimeException e) {
            String msg = String
                .format("XKMS locate call fails for certificate: %s. Error: %s",
                        ids,
View Full Code Here


                                   QueryKeyBindingType queryKeyBindingType,
                                   UseKeyWithType useKeyWithType) {
        queryKeyBindingType.getUseKeyWith().add(useKeyWithType);

        request.setQueryKeyBinding(queryKeyBindingType);
        LocateResultType result = xkmsService.locate(request);
        assertSuccess(result);
        List<UnverifiedKeyBindingType> keyBinding = result.getUnverifiedKeyBinding();
        Assert.assertEquals(1, keyBinding.size());
        KeyInfoType keyInfo = keyBinding.get(0).getKeyInfo();
        Assert.assertNotNull(keyInfo);
    }
View Full Code Here

    }

    public X509Certificate getCertificate(List<X509AppId> ids) {
        try {
            LocateRequestType locateRequestType = prepareLocateXKMSRequest(ids);
            LocateResultType locateResultType = xkmsConsumer.locate(locateRequestType);
            return parseLocateXKMSResponse(locateResultType, ids);
        } catch (RuntimeException e) {
            String msg = String
                .format("XKMS locate call fails for certificate: %s. Error: %s",
                        ids,
View Full Code Here

    }

    public X509Certificate getCertificate(List<X509AppId> ids) {
        try {
            LocateRequestType locateRequestType = prepareLocateXKMSRequest(ids);
            LocateResultType locateResultType = xkmsConsumer.locate(locateRequestType);
            return parseLocateXKMSResponse(locateResultType, ids);
        } catch (RuntimeException e) {
            String msg = String
                .format("XKMS locate call fails for certificate: %s. Error: %s",
                        ids,
View Full Code Here

        useKeyWithType.setApplication(Applications.PKIX.getUri());

        queryKeyBindingType.getUseKeyWith().add(useKeyWithType);

        request.setQueryKeyBinding(queryKeyBindingType);
        LocateResultType result = xkmsService.locate(request);
        Assert.assertEquals(ResultMajorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_SUCCESS.value(),
                            result.getResultMajor());
        List<UnverifiedKeyBindingType> keyBinding = result.getUnverifiedKeyBinding();
        Assert.assertEquals(1, keyBinding.size());
        KeyInfoType keyInfo = keyBinding.get(0).getKeyInfo();
        Assert.assertNotNull(keyInfo);
    }
View Full Code Here

        }
    }

    @Override
    public LocateResultType locate(LocateRequestType request) {
        LocateResultType response = XKMSResponseFactory.createResponse(request, new LocateResultType());
        try {
            validateRequest(request);
            // Search
            for (Locator locator : locators) {
                UnverifiedKeyBindingType keyBinding = locator.locate(request);
                if (keyBinding != null) {
                    response.getUnverifiedKeyBinding().add(keyBinding);
                    return response;
                }
            }
            // No matches found
            response.setResultMinor(ResultMinorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_NO_MATCH.value());
            return response;
        } catch (Exception e) {
            return handleException("locate", e, response);
        }
    }
View Full Code Here

        keyInfoContent.add(x509Data);
        return keyInfo;
    }

    LocateResultType createResponse(LocateRequestType request) {
        LocateResultType ret = new LocateResultType();
        ret.setId(UUID.randomUUID().toString());
        ret.setRequestId(request.getId());
        ret.setService("http://services.sopera.org/xkms/v2.0");
        return ret;
    }
View Full Code Here

    @Override
    public LocateResultType locate(LocateRequestType request) {
        try {
            validateRequest(request);
            // Create basic response
            LocateResultType result = XKMSResponseFactory.createResponse(request, new LocateResultType());
            // Search
            for (Locator locator : locators) {
                UnverifiedKeyBindingType keyBinding = locator.locate(request);
                if (keyBinding != null) {
                    result.getUnverifiedKeyBinding().add(keyBinding);
                    return result;
                }
            }
            // No matches found
            result.setResultMinor(ResultMinorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_NO_MATCH.value());
            return result;
        } catch (Exception e) {
            return ExceptionMapper.toResponse(e, XKMSResponseFactory.createResponse(request, new LocateResultType()));
        }
    }
View Full Code Here

                                   QueryKeyBindingType queryKeyBindingType,
                                   UseKeyWithType useKeyWithType) {
        queryKeyBindingType.getUseKeyWith().add(useKeyWithType);

        request.setQueryKeyBinding(queryKeyBindingType);
        LocateResultType result = xkmsService.locate(request);
        Assert.assertEquals(ResultMajorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_SUCCESS.value(),
                            result.getResultMajor());
        List<UnverifiedKeyBindingType> keyBinding = result.getUnverifiedKeyBinding();
        Assert.assertEquals(1, keyBinding.size());
        KeyInfoType keyInfo = keyBinding.get(0).getKeyInfo();
        Assert.assertNotNull(keyInfo);
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.xkms.model.xkms.LocateResultType

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.