Package org.wso2.xkms2

Examples of org.wso2.xkms2.XKMSException


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

    public static ReissueRequest createReissueRequest() {
        ReissueRequest reissueRequest = new ReissueRequest();
        reissueRequest.setId(XKMSUtil.getRamdomId());
        return reissueRequest;
    }
View Full Code Here


        recoverResult.setId(getRamdomId());
        return recoverResult;
    }
   
    public static ReissueResult creatReissueResult() {
        ReissueResult reissueResult = new ReissueResult();
        reissueResult.setId(getRamdomId());
        return reissueResult;
    }
View Full Code Here

            if (alias == null) {
                throw new XKMSException(XKMSException.FAILURE, "CertNotFound");
            }

            ReissueResult result = XKMSUtil.creatReissueResult();
            buildResultType(request, result, alias, keystore);
            return result;

        } catch (XKMSException ex) {
            ReissueResult result = XKMSUtil.creatReissueResult();
            buildFault(request, result, ex);
            return result;
        }
    }
View Full Code Here

    }

    public ResultType process(XKMSRequestData data) throws AxisFault {

        RequestAbstractType request = data.getRequest();
        this.doc = data.getDocument();

        if (request instanceof RegisterRequest) {
            return handleRegisterRequest((RegisterRequest) request);
View Full Code Here

            X509Certificate[] certs, KeyBindingAbstractType abstractType) {

        KeyInfo keyInfo = new KeyInfo(doc);

        for (Iterator iterator = respondWiths.iterator(); iterator.hasNext();) {
            RespondWith respondWith = (RespondWith) iterator.next();

            if (respondWith.equals(RespondWith.KEY_NAME)) {
                KeyName keyName = new KeyName(doc, aliase);
                keyInfo.add(keyName);

            } else if (respondWith.equals(RespondWith.KEY_VALUE)) {
                PublicKey publicKey = certs[0].getPublicKey();
                KeyValue keyValue = new KeyValue(doc, publicKey);
                keyInfo.add(keyValue);

            } else if (respondWith.equals(RespondWith.X_509_CERT)) {
                addX509Certificate(certs[0], keyInfo);

            } else if (respondWith.equals(RespondWith.X_509_CHAIN)) {
                for (int i = 0; i < certs.length; i++) {
                    addX509Certificate(certs[i], keyInfo);
                }

            } else {
View Full Code Here

            OMElement result = sendReceive(element, serverURL);
            result = buildElement(result);

            RecoverResult recoverResult = getRecoverResult(result);

            ResultMinor resultMinor = recoverResult.getResultMinor();
            if (resultMinor != null && ResultMinor.NO_MATCH.equals(resultMinor)) {
                return null;
            }

            org.wso2.xkms2.PrivateKey xkmsPrivateKey = recoverResult
View Full Code Here

            request.setAuthentication(authentication);

            RecoverKeyBinding keyBinding = createRecoverKeyBinding();
            keyBinding.setKeyName(alias);

            Status status = new Status();
            status.setStatusValue(StatusValue.INDETERMINATE);
            keyBinding.setStatus(status);

            request.setRecoverKeyBinding(keyBinding);

            request.addRespondWith(RespondWith.PRIVATE_KEY);
View Full Code Here

            ValidateResult validateResult = getValidateResult(result);
            List keybinds = validateResult.getKeyBindingList();
            KeyBinding keybinding = (KeyBinding) keybinds.get(0);

            Status status = keybinding.getStatus();

            return StatusValue.VALID.equals(status.getStatusValue());

        } catch (Exception ex) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("", ex);
            }
View Full Code Here

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

                for (int i = 0; i < keybindings.size(); i++) {
                    UnverifiedKeyBinding unverifiedKeybinding = (UnverifiedKeyBinding) keybindings
                            .get(i);
                    KeyInfo keyInfo = unverifiedKeybinding.getKeyInfo();
                    certs[i] = keyInfo.getX509Certificate();
                }
                return certs;
            }
View Full Code Here

                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();
            }

        } catch (Exception ex) {
View Full Code Here

TOP

Related Classes of org.wso2.xkms2.XKMSException

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.