Package org.wso2.xkms2

Examples of org.wso2.xkms2.LocateRequest


    public static String getAliasForX509Certificate(byte[] skiValue,
                                                    String serviceURL) {
        try {

            LocateRequest request = createLocateRequest();
            request.setServiceURI(serviceURL);

            QueryKeyBinding queryKeybinding = createQueryKeyBinding();
            queryKeybinding.addUseKeyWith(UseKeyWith.SKI, Base64
                    .encode(skiValue));
            request.setQueryKeyBinding(queryKeybinding);

            request.addRespondWith(RespondWith.KEY_NAME);

            OMElement element = getAsOMElement(request);
            OMElement result = sendReceive(element, serviceURL);
            result = buildElement(result);
View Full Code Here


        }
    }

    public static String[] getAliasesForDN(String subjectDN, String serviceURL) {
        try {
            LocateRequest request = createLocateRequest();
            request.setServiceURI(serviceURL);

            QueryKeyBinding queryKeybinding = createQueryKeyBinding();
            queryKeybinding.addUseKeyWith(UseKeyWith.PKIX, subjectDN);
            request.setQueryKeyBinding(queryKeybinding);

            request.addRespondWith(RespondWith.KEY_NAME);

            OMElement element = getAsOMElement(request);
            OMElement result = sendReceive(element, serviceURL);
            result = buildElement(result);
View Full Code Here

        validate.setId(XKMSUtil.getRamdomId());
        return validate;
    }

    public static LocateRequest createLocateRequest() {
        LocateRequest locate = new LocateRequest();
        locate.setId(XKMSUtil.getRamdomId());
        return locate;
    }
View Full Code Here

public class LocateRequestBuilder extends KISSRequestBuilder {

    private LocateRequest locateRequest;

    public LocateRequestBuilder() {
        this.locateRequest = new LocateRequest();
    }
View Full Code Here

        validate.setId(XKMSUtil.getRamdomId());
        return validate;
    }
   
    public static LocateRequest createLocateRequest() {
        LocateRequest locate = new LocateRequest();
        locate.setId(XKMSUtil.getRamdomId());
        return locate;
    }
View Full Code Here

            OMElement element = getAsOMElement(request);
            OMElement result = sendReceive(element, serviceURL);
            result = buildElement(result);

            LocateResult locateResult = getLocateResult(result);

            if (ResultMinor.NO_MATCH.equals(locateResult.getResultMinor())) {
                return null;

            } else {

                List keybindings = locateResult.getUnverifiedKeyBindingList();
                X509Certificate[] certs = new X509Certificate[keybindings
                        .size()];

                for (int i = 0; i < keybindings.size(); i++) {
                    UnverifiedKeyBinding unverifiedKeybinding = (UnverifiedKeyBinding) keybindings
View Full Code Here

            OMElement element = getAsOMElement(request);
            OMElement result = sendReceive(element, serviceURL);
            result = buildElement(result);

            LocateResult locateResult = getLocateResult(result);

            if (ResultMinor.NO_MATCH.equals(locateResult.getResultMinor())) {
                return null;

            } else {

                List keybindings = locateResult.getUnverifiedKeyBindingList();
                UnverifiedKeyBinding keybinding = (UnverifiedKeyBinding) keybindings
                        .get(0);
                KeyInfo keyInfo = keybinding.getKeyInfo();
                KeyName keyName = keyInfo.itemKeyName(0);
                return keyName.getKeyName();
View Full Code Here

            OMElement element = getAsOMElement(request);
            OMElement result = sendReceive(element, serviceURL);
            result = buildElement(result);

            LocateResult locateResult = getLocateResult(result);

            if (ResultMinor.NO_MATCH.equals(locateResult.getResultMinor())) {
                return null;

            } else {

                List keybindings = locateResult.getUnverifiedKeyBindingList();
                UnverifiedKeyBinding keybinding = (UnverifiedKeyBinding) keybindings
                        .get(0);
                KeyInfo keyInfo = keybinding.getKeyInfo();
                KeyName keyName = keyInfo.itemKeyName(0);
                return keyName.getKeyName();
View Full Code Here

            OMElement element = getAsOMElement(request);
            OMElement result = sendReceive(element, serviceURL);
            result = buildElement(result);

            LocateResult locateResult = getLocateResult(result);

            if (ResultMinor.NO_MATCH.equals(locateResult.getResultMinor())) {
                return null;

            } else {

                List keybindings = locateResult.getUnverifiedKeyBindingList();
                String[] aliases = new String[keybindings.size()];

                for (int i = 0; i < keybindings.size(); i++) {
                    UnverifiedKeyBinding unverifiedKeybinding = (UnverifiedKeyBinding) keybindings
                            .get(i);
View Full Code Here

        return request.serialize(factory);
    }

    private static LocateResult getLocateResult(OMElement result)
            throws Exception {
        LocateResult locateResult = (LocateResult) LocateResultBuilder.INSTANCE
                .buildElement(result);
        return locateResult;
    }
View Full Code Here

TOP

Related Classes of org.wso2.xkms2.LocateRequest

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.