Examples of AlgorithmSuiteType


Examples of org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType

                if (MessageUtils.isRequestor(message) && recToken.getToken() instanceof X509Token) {
                    config.put(ConfigurationConstants.DERIVED_TOKEN_REFERENCE, "EncryptedKey");
                } else {
                    config.put(ConfigurationConstants.DERIVED_TOKEN_REFERENCE, "DirectReference");
                }
                AlgorithmSuiteType algSuiteType = sbinding.getAlgorithmSuite().getAlgorithmSuiteType();
                config.put(ConfigurationConstants.DERIVED_ENCRYPTION_KEY_LENGTH,
                           "" + algSuiteType.getEncryptionDerivedKeyLength() / 8);
            }

            if (recToken.getVersion() == SPConstants.SPVersion.SP12) {
                config.put(ConfigurationConstants.USE_2005_12_NAMESPACE, "true");
            }
View Full Code Here

Examples of org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType

            if (MessageUtils.isRequestor(message) && policyToken instanceof X509Token) {
                config.put(ConfigurationConstants.DERIVED_TOKEN_REFERENCE, "EncryptedKey");
            } else {
                config.put(ConfigurationConstants.DERIVED_TOKEN_REFERENCE, "DirectReference");
            }
            AlgorithmSuiteType algSuiteType = sbinding.getAlgorithmSuite().getAlgorithmSuiteType();
            config.put(ConfigurationConstants.DERIVED_SIGNATURE_KEY_LENGTH,
                       "" + algSuiteType.getSignatureDerivedKeyLength() / 8);
        }
       
        if (policyToken.getVersion() == SPConstants.SPVersion.SP12) {
            config.put(ConfigurationConstants.USE_2005_12_NAMESPACE, "true");
        }
View Full Code Here

Examples of org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType

        String sigUser = (String)message.getContextualProperty(userNameKey);
        if (sigUser != null) {
            config.put(ConfigurationConstants.SIGNATURE_USER, sigUser);
        }

        AlgorithmSuiteType algType = binding.getAlgorithmSuite().getAlgorithmSuiteType();
        config.put(ConfigurationConstants.SIG_DIGEST_ALGO, algType.getDigest());
        // sig.setSigCanonicalization(binding.getAlgorithmSuite().getC14n().getValue());

    }
View Full Code Here

Examples of org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType

            aim.get(new QName(spNamespace, SPConstants.ALGORITHM_SUITE));
        if (sp11Ais != null) {
            for (AssertionInfo ai : sp11Ais) {
                ai.setAsserted(true);
                AlgorithmSuite algorithmSuite = (AlgorithmSuite)ai.getAssertion();
                AlgorithmSuiteType algorithmSuiteType = algorithmSuite.getAlgorithmSuiteType();
                String namespace = algorithmSuiteType.getNamespace();
                if (namespace == null) {
                    namespace = spNamespace;
                }
                Collection<AssertionInfo> algAis =
                    aim.get(new QName(namespace, algorithmSuiteType.getName()));
                if (algAis != null) {
                    for (AssertionInfo algAi : algAis) {
                        algAi.setAsserted(true);
                    }
                }
View Full Code Here

Examples of org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType

            doSignature(token, wrapper);
           
            config.put(ConfigurationConstants.INCLUDE_SIGNATURE_TOKEN, "true");
            config.put(ConfigurationConstants.SIG_ALGO,
                       tbinding.getAlgorithmSuite().getSymmetricSignature());
            AlgorithmSuiteType algType = tbinding.getAlgorithmSuite().getAlgorithmSuiteType();
            config.put(ConfigurationConstants.SIG_DIGEST_ALGO, algType.getDigest());
        } else if (token instanceof X509Token || token instanceof KeyValueToken) {
            doSignature(token, wrapper);
        } else if (token instanceof SamlToken) {
            addSamlToken((SamlToken)token, false, true);
            signPartsAndElements(wrapper.getSignedParts(), wrapper.getSignedElements());
           
            Map<String, Object> config = getProperties();
            config.put(ConfigurationConstants.SIG_ALGO,
                       tbinding.getAlgorithmSuite().getAsymmetricSignature());
            AlgorithmSuiteType algType = tbinding.getAlgorithmSuite().getAlgorithmSuiteType();
            config.put(ConfigurationConstants.SIG_DIGEST_ALGO, algType.getDigest());
        } else if (token instanceof UsernameToken) {
            throw new Exception("Endorsing UsernameTokens are not supported in the streaming code");
        } else if (token instanceof KerberosToken) {
            Map<String, Object> config = getProperties();
            String signatureAction = ConfigurationConstants.SIGNATURE;
            if (config.containsKey(ConfigurationConstants.ACTION)) {
                String action = (String)config.get(ConfigurationConstants.ACTION);
                config.put(ConfigurationConstants.ACTION, action + " " + signatureAction);
            } else {
                config.put(ConfigurationConstants.ACTION, signatureAction);
            }
            configureSignature(wrapper, token, false);
           
            addKerberosToken((KerberosToken)token, false, true, false);
            signPartsAndElements(wrapper.getSignedParts(), wrapper.getSignedElements());
           
            config.put(ConfigurationConstants.SIG_ALGO,
                       tbinding.getAlgorithmSuite().getSymmetricSignature());
            AlgorithmSuiteType algType = tbinding.getAlgorithmSuite().getAlgorithmSuiteType();
            config.put(ConfigurationConstants.SIG_DIGEST_ALGO, algType.getDigest());
        }
    }
View Full Code Here

Examples of org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType

            alsoIncludeToken = true;
        }
       
        String encrUser = setEncryptionUser(encrKey, wrapper, false, crypto);
       
        AlgorithmSuiteType algType = binding.getAlgorithmSuite().getAlgorithmSuiteType();
        encrKey.setSymmetricEncAlgorithm(algType.getEncryption());
        encrKey.setKeyEncAlgo(algType.getAsymmetricKeyWrap());
       
        encrKey.prepare(saaj.getSOAPPart(), crypto);
       
        if (alsoIncludeToken) {
            CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
View Full Code Here

Examples of org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType

        }

        String password = getPassword(user, token, WSPasswordCallback.SIGNATURE);
        sig.setUserInfo(user, password);
        sig.setSignatureAlgorithm(binding.getAlgorithmSuite().getAsymmetricSignature());
        AlgorithmSuiteType algType = binding.getAlgorithmSuite().getAlgorithmSuiteType();
        sig.setDigestAlgo(algType.getDigest());
        sig.setSigCanonicalization(binding.getAlgorithmSuite().getC14n().getValue());
        sig.setWsConfig(wssConfig);
        try {
            sig.prepare(saaj.getSOAPPart(), crypto, secHeader);
        } catch (WSSecurityException e) {
View Full Code Here

Examples of org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType

            dkSign.setExternalKey(tok.getSecret(), tok.getId());
        }

        //Set the algo info
        dkSign.setSignatureAlgorithm(binding.getAlgorithmSuite().getSymmetricSignature());
        AlgorithmSuiteType algType = binding.getAlgorithmSuite().getAlgorithmSuiteType();
        dkSign.setDerivedKeyLength(algType.getSignatureDerivedKeyLength() / 8);
        if (tok.getSHA1() != null) {
            //Set the value type of the reference
            dkSign.setCustomValueType(WSConstants.SOAPMESSAGE_NS11 + "#"
                + WSConstants.ENC_KEY_VALUE_TYPE);
        } else if (policyToken instanceof UsernameToken) {
View Full Code Here

Examples of org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType

            writer.writeStartElement("wst", "BinarySecret", namespace);
            writer.writeAttribute("Type", namespace + "/Nonce");
            if (algorithmSuite == null) {
                requestorEntropy = WSSecurityUtil.generateNonce(keySize / 8);
            } else {
                AlgorithmSuiteType algType = algorithmSuite.getAlgorithmSuiteType();
                requestorEntropy = WSSecurityUtil
                    .generateNonce(algType.getMaximumSymmetricKeyLength() / 8);
            }
            writer.writeCharacters(Base64.encode(requestorEntropy));

            writer.writeEndElement();
            writer.writeEndElement();
View Full Code Here

Examples of org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType

        Collection<AssertionInfo> algorithmSuiteAis = aim.get(algorithmSuite.getName());
        for (AssertionInfo ai : algorithmSuiteAis) {
            ai.setAsserted(true);
        }
       
        AlgorithmSuiteType algorithmSuiteType = algorithmSuite.getAlgorithmSuiteType();
        String namespace = algorithmSuiteType.getNamespace();
        if (namespace != null) {
            Collection<AssertionInfo> algAis =
                aim.get(new QName(namespace, algorithmSuiteType.getName()));
            if (algAis != null) {
                for (AssertionInfo algAi : algAis) {
                    algAi.setAsserted(true);
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.