Examples of WSSecSignature


Examples of org.apache.wss4j.dom.message.WSSecSignature

            Document doc = documentBuilderFactory.newDocumentBuilder().parse(sourceDocument);
            WSSecHeader secHeader = new WSSecHeader();
            secHeader.insertSecurityHeader(doc);

            WSSecSignature sign = new WSSecSignature();
            sign.setKeyIdentifierType(WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER);
            sign.setSecretKey(key.getEncoded());
            sign.setSignatureAlgorithm(SignatureMethod.HMAC_SHA1);

            Document securedDocument = sign.build(doc, null, secHeader);

            //some test that we can really sure we get what we want from WSS4J
            XPathExpression xPathExpression =
                    getXPath("/soap:Envelope/soap:Header/wsse:Security/dsig:Signature/dsig:KeyInfo/" +
                                    "wsse:SecurityTokenReference/wsse:KeyIdentifier[@ValueType=" +
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.