Package org.wso2.xkms2

Examples of org.wso2.xkms2.XKMSException


            OMElement element = getAsOMElement(request);
            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
                    .getPrivateKey();
            xkmsPrivateKey.setKey(XKMSKeyUtil.getPrivateKey(passPhrase,
                                                            "DESede"));
            KeyPair keyPair = xkmsPrivateKey.getRSAKeyPair();
            return keyPair.getPrivate();
View Full Code Here


        keyBinding.setId(getRamdomId());
        return keyBinding;
    }
   
    public static RecoverResult createRecoverResult() {
        RecoverResult recoverResult = new RecoverResult();
        recoverResult.setId(getRamdomId());
        return recoverResult;
    }
View Full Code Here

            if (aliases == null || aliases.length < 1) {
                throw new XKMSException(XKMSException.NO_MATCH, "keyNotFound");
            }

            RecoverResult recoverResult = XKMSUtil.createRecoverResult();
            buildResultType(request, recoverResult, aliases[0], keystore);
            return recoverResult;

        } catch (XKMSException ex) {
            RecoverResult recoverResult = XKMSUtil.createRecoverResult();
            buildFault(request, recoverResult, ex);
            return recoverResult;
        }

    }
View Full Code Here

        return (RecoverResult) RecoverResultBuilder.INSTANCE
                .buildElement(recoverResultElem);
    }

    public static RegisterRequest createRegisterRequest() {
        RegisterRequest request = new RegisterRequest();
        request.setId(XKMSUtil.getRamdomId());
        return request;
    }
View Full Code Here

            System.out.print(bytes[i]);
        }
    }

    public static RegisterResult createRegisterResult() {
        RegisterResult result = new RegisterResult();
        result.setId(getRamdomId());
        return result;
    }
View Full Code Here

            } catch (KeyStoreException e) {
                LOG.error("Adding the certificate to keystore failed", e);
                throw new XKMSException(e);
            }

            RegisterResult result = XKMSUtil.createRegisterResult();
            buildResultType(request, result, aliase, keystore);
            return result;

        } catch (XKMSException ex) {

            RegisterResult resultType = XKMSUtil.createRegisterResult();
            buildFault(request, resultType, ex);
            return resultType;
        }
    }
View Full Code Here

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

    public static ReissueKeyBinding createReissueKeyBinding() {
        ReissueKeyBinding reissueKeyBinding = new ReissueKeyBinding();
        reissueKeyBinding.setId(XKMSUtil.getRamdomId());
        return reissueKeyBinding;
    }
View Full Code Here

    private ReissueKeyBindingBuilder() {
    }

    public XKMSElement buildElement(OMElement element) throws XKMSException {
        ReissueKeyBinding reissueKeyBinding = new ReissueKeyBinding();
        KeyBindingBuilder.INSTANCE.buildElement(element, reissueKeyBinding);
        return reissueKeyBinding;
    }
View Full Code Here

        try {
            prepare(request, request.getReissueKeyBinding());
            validate(request);

            ReissueKeyBinding rkb = request.getReissueKeyBinding();
            X509Certificate cert = rkb.getCertValue();

            if (cert == null) {
                throw new XKMSException(XKMSException.FAILURE, "CertNotPresent");
            }
View Full Code Here

    }

    private void validate(ReissueRequest reissueRequest) throws XKMSException {
        validate((KRSSRequest) reissueRequest);

        ReissueKeyBinding rkb = reissueRequest.getReissueKeyBinding();
        XMLSignature pop = reissueRequest.getProofOfPocession();

        Key key = rkb.getKeyValue();
        if (key == null) {
            X509Certificate cert = rkb.getCertValue();

            if (cert != null) {
                key = cert.getPublicKey();
            }
        }
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.