Examples of addWSSENamespace()


Examples of org.apache.ws.security.message.token.BinarySecurity.addWSSENamespace()

            Document doc = DOMUtils.createDocument();
           
            // Mock up a BinarySecurityToken
            String id = "BST-1234";
            BinarySecurity bst = new BinarySecurity(doc);
            bst.addWSSENamespace();
            bst.addWSUNamespace();
            bst.setID(id);
            bst.setValueType(TOKEN_TYPE);
            bst.setEncodingType(BASE64_NS);
            bst.setToken("12345678".getBytes());
View Full Code Here

Examples of org.apache.ws.security.message.token.BinarySecurity.addWSSENamespace()

            Document doc = DOMUtils.createDocument();
           
            // Mock up a dummy BinarySecurityToken
            String id = "BST-1234";
            BinarySecurity bst = new BinarySecurity(doc);
            bst.addWSSENamespace();
            bst.addWSUNamespace();
            bst.setID(id);
            bst.setValueType(TOKEN_TYPE);
            bst.setEncodingType(BASE64_NS);
            bst.setToken("12345678".getBytes());
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityTokenReference.addWSSENamespace()

        ref.setURI(id);
        if (refValueType != null) {
            ref.setValueType(refValueType);
        }
        SecurityTokenReference str = new SecurityTokenReference(writer.getDocument());
        str.addWSSENamespace();
        str.setReference(ref);

        writer.getCurrentNode().appendChild(str.getElement());
        return str.getElement();
    }
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityTokenReference.addWSSENamespace()

     * @throws ConversationException
     */
    private KeyInfo createKeyInfo() throws WSSecurityException, ConversationException {
        KeyInfo keyInfo = new KeyInfo(document);
        SecurityTokenReference secToken = new SecurityTokenReference(document);
        secToken.addWSSENamespace();
        Reference ref = new Reference(document);
        ref.setURI("#" + dktId);
        String ns =
            ConversationConstants.getWSCNs(getWscVersion())
                + ConversationConstants.TOKEN_TYPE_DERIVED_KEY_TOKEN;
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityTokenReference.addWSSENamespace()

        KeyInfo keyInfo = new KeyInfo(document);
        if (embedEncryptedKey) {
            keyInfo.addUnknownElement(getEncryptedKeyElement());
        } else if (keyIdentifierType == WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER) {
            SecurityTokenReference secToken = new SecurityTokenReference(document);
            secToken.addWSSENamespace();
            if (customReferenceValue != null) {
                secToken.setKeyIdentifierEncKeySHA1(customReferenceValue);
            } else {
                byte[] encodedBytes = WSSecurityUtil.generateDigest(encryptedEphemeralKey);
                secToken.setKeyIdentifierEncKeySHA1(Base64.encode(encodedBytes));
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityTokenReference.addWSSENamespace()

            keyInfo.addUnknownElement(secToken.getElement());
        } else if (keyIdentifierType == WSConstants.EMBEDDED_KEYNAME) {
            keyInfo.addKeyName(embeddedKeyName == null ? user : embeddedKeyName);
        } else if (WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(customReferenceValue)) {
            SecurityTokenReference secToken = new SecurityTokenReference(document);
            secToken.addWSSENamespace();
            secToken.addTokenType(WSConstants.WSS_SAML_TOKEN_TYPE);
            secToken.setKeyIdentifier(WSConstants.WSS_SAML_KI_VALUE_TYPE, encKeyId);
            keyInfo.addUnknownElement(secToken.getElement());
        } else if (WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(customReferenceValue)) {
            SecurityTokenReference secToken = new SecurityTokenReference(document);
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityTokenReference.addWSSENamespace()

            secToken.addTokenType(WSConstants.WSS_SAML_TOKEN_TYPE);
            secToken.setKeyIdentifier(WSConstants.WSS_SAML_KI_VALUE_TYPE, encKeyId);
            keyInfo.addUnknownElement(secToken.getElement());
        } else if (WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(customReferenceValue)) {
            SecurityTokenReference secToken = new SecurityTokenReference(document);
            secToken.addWSSENamespace();
            secToken.addTokenType(WSConstants.WSS_SAML2_TOKEN_TYPE);
            secToken.setKeyIdentifier(WSConstants.WSS_SAML2_KI_VALUE_TYPE, encKeyId);
            keyInfo.addUnknownElement(secToken.getElement());
        } else if (WSConstants.WSS_KRB_KI_VALUE_TYPE.equals(customReferenceValue)) {
            SecurityTokenReference secToken = new SecurityTokenReference(document);
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityTokenReference.addWSSENamespace()

            secToken.addTokenType(WSConstants.WSS_SAML2_TOKEN_TYPE);
            secToken.setKeyIdentifier(WSConstants.WSS_SAML2_KI_VALUE_TYPE, encKeyId);
            keyInfo.addUnknownElement(secToken.getElement());
        } else if (WSConstants.WSS_KRB_KI_VALUE_TYPE.equals(customReferenceValue)) {
            SecurityTokenReference secToken = new SecurityTokenReference(document);
            secToken.addWSSENamespace();
            secToken.addTokenType(WSConstants.WSS_GSS_KRB_V5_AP_REQ);
            secToken.setKeyIdentifier(customReferenceValue, encKeyId, true);
            keyInfo.addUnknownElement(secToken.getElement());
        } else if (securityTokenReference != null) {
            Element tmpE = securityTokenReference.getElement();
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityTokenReference.addWSSENamespace()

                WSConstants.XMLNS_NS, "xmlns:" + tmpE.getPrefix(), tmpE.getNamespaceURI()
            );
            keyInfo.addUnknownElement(securityTokenReference.getElement());
        } else if (encKeyId != null) {
            SecurityTokenReference secToken = new SecurityTokenReference(document);
            secToken.addWSSENamespace();
            Reference ref = new Reference(document);
            if (encKeyIdDirectId) {
                ref.setURI(encKeyId);
            } else {
                ref.setURI("#" + encKeyId);                   
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityTokenReference.addWSSENamespace()

        KeyInfo keyInfo = new KeyInfo(document);
        if (embedEncryptedKey) {
            keyInfo.addUnknownElement(getEncryptedKeyElement());
        } else if (keyIdentifierType == WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER) {
            SecurityTokenReference secToken = new SecurityTokenReference(document);
            secToken.addWSSENamespace();
            if (customReferenceValue != null) {
                secToken.setKeyIdentifierEncKeySHA1(customReferenceValue);
            } else {
                byte[] encodedBytes = WSSecurityUtil.generateDigest(encryptedEphemeralKey);
                secToken.setKeyIdentifierEncKeySHA1(Base64.encode(encodedBytes));
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.