Examples of AlgorithmSuiteType


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

                    // Right now we only use PSHA1 as the computed key algo
                    P_SHA1 psha1 = new P_SHA1();

                    int length = (keySize > 0) ? keySize : 256;
                    if (algorithmSuite != null) {
                        AlgorithmSuiteType algType = algorithmSuite.getAlgorithmSuiteType();
                        length = (keySize > 0) ? keySize : algType.getMaximumSymmetricKeyLength();
                    }
                    try {
                        secret = psha1.createKey(requestorEntropy, serviceEntr, 0, length / 8);
                    } catch (WSSecurityException e) {
                        throw new TrustException("DERIVED_KEY_ERROR", LOG, e);
View Full Code Here

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

                } else {
                    dkEncr.setCustomValueType(tokenType);
                }
            }
           
            AlgorithmSuiteType algType = sbinding.getAlgorithmSuite().getAlgorithmSuiteType();
            dkEncr.setSymmetricEncAlgorithm(algType.getEncryption());
            dkEncr.setDerivedKeyLength(algType.getEncryptionDerivedKeyLength() / 8);
            dkEncr.prepare(saaj.getSOAPPart());
            Element encrDKTokenElem = null;
            encrDKTokenElem = dkEncr.getdktElement();
            addDerivedKeyElement(encrDKTokenElem);
            Element refList = dkEncr.encryptForExternalRef(null, encrParts);
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(sbinding.getAlgorithmSuite().getSymmetricSignature());
        AlgorithmSuiteType algType = sbinding.getAlgorithmSuite().getAlgorithmSuiteType();
        dkSign.setDerivedKeyLength(algType.getSignatureDerivedKeyLength() / 8);
        if (tok.getSHA1() != null) {
            //Set the value type of the reference
            String tokenType = tok.getTokenType();
            if (tokenType == null) {
                tokenType = WSConstants.WSS_ENC_KEY_VALUE_TYPE;
View Full Code Here

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

    ) {
        for (AssertionInfo ai : ais) {
            ai.setAsserted(true);
            AlgorithmSuite algorithmSuite = (AlgorithmSuite)ai.getAssertion();
      
            AlgorithmSuiteType algorithmSuiteType = algorithmSuite.getAlgorithmSuiteType();
            String namespace = algorithmSuiteType.getNamespace();
            if (namespace != null && !namespace.equals(algorithmSuite.getName().getNamespaceURI())) {
                Collection<AssertionInfo> algAis =
                    aim.get(new QName(namespace, algorithmSuiteType.getName()));
                if (algAis != null && !algAis.isEmpty()) {
                    for (AssertionInfo algAi : algAis) {
                        algAi.setAsserted(true);
                    }
                }
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

           
            WSSecDKSign dkSig = new WSSecDKSign(wssConfig);
           
            dkSig.setSigCanonicalization(binding.getAlgorithmSuite().getC14n().getValue());
            dkSig.setSignatureAlgorithm(binding.getAlgorithmSuite().getSymmetricSignature());
            AlgorithmSuiteType algType = binding.getAlgorithmSuite().getAlgorithmSuiteType();
            dkSig.setDerivedKeyLength(algType.getSignatureDerivedKeyLength() / 8);
           
            dkSig.setExternalKey(encrKey.getEphemeralKey(), encrKey.getId());
           
            dkSig.prepare(doc, secHeader);
           
View Full Code Here

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

            dkSign.setCustomValueType(WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE);
        }

        // Set the algo info
        dkSign.setSignatureAlgorithm(algorithmSuite.getSymmetricSignature());
        AlgorithmSuiteType algType = binding.getAlgorithmSuite().getAlgorithmSuiteType();
        dkSign.setDerivedKeyLength(algType.getSignatureDerivedKeyLength() / 8);
        if (token.getVersion() == SPConstants.SPVersion.SP12) {
            dkSign.setWscVersion(ConversationConstants.VERSION_05_12);
        }
        Document doc = saaj.getSOAPPart();
        dkSign.prepare(doc, secHeader);
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.