Package org.wso2.xkms2.builder

Examples of org.wso2.xkms2.builder.RecoverRequestBuilderTest


            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

        kb.setValidityInterval(notBefore, notAfter);
    }

    private void addStatus(boolean valid, KeyBinding kb) {
        Status status = new Status();
        status
                .setStatusValue((valid) ? StatusValue.VALID
                        : StatusValue.INVALID);
        if (valid) {
            status.addValidReason(ValidReason.ISSUER_TRUST);
            status.addValidReason(ValidReason.REVOCATION_STATUS);
            status.addValidReason(ValidReason.SIGNATURE);
            status.addValidReason(ValidReason.VALIDITY_INTERVAL);
        } else {
            status.addInvalidReason(InvalidReason.ISSUER_TRUST);
            status.addInvalidReason(InvalidReason.REVOCATION_STATUS);
            status.addInvalidReason(InvalidReason.SIGNATURE);
            status.addInvalidReason(InvalidReason.VALIDITY_INTERVAL);
        }
        kb.setStatus(status);
    }
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

                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

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

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

            buildResultType((RequestAbstractType) locate, (ResultType) result);

            for (Iterator iterator = list.iterator(); iterator.hasNext();) {
                String alias = (String) iterator.next();
                X509Certificate[] certs = getCertificates(alias);
                UnverifiedKeyBinding ukb = new UnverifiedKeyBinding();

                addKeyInfo(locate.getRespondWith(), alias, certs, ukb);
                addKeyUsage(certs[0], ukb);
                result.addUnverifiedKeyBinding(ukb);
            }
View Full Code Here

        if (useKeyWiths == null || useKeyWiths.isEmpty()) {
            return null;
        }

        for (Iterator iterator = useKeyWiths.iterator(); iterator.hasNext();) {
            UseKeyWith useKeyWith = (UseKeyWith) iterator.next();

            if (UseKeyWith.PKIX.equals(useKeyWith.getApplication())) {
                return useKeyWith.getIdentifier();
            }
        }

        return null;
    }
View Full Code Here

        if (useKeyWiths == null || useKeyWiths.isEmpty()) {
            return null;
        }

        for (Iterator iterator = useKeyWiths.iterator(); iterator.hasNext();) {
            UseKeyWith useKeyWith = (UseKeyWith) iterator.next();

            if (UseKeyWith.SKI.equals(useKeyWith.getApplication())) {
                return Base64.decode(useKeyWith.getIdentifier());
            }
        }

        return null;
    }
View Full Code Here

TOP

Related Classes of org.wso2.xkms2.builder.RecoverRequestBuilderTest

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.