Package javax.xml.crypto.dsig

Examples of javax.xml.crypto.dsig.XMLSignature.sign()


        Document document = this.documentBuilderFactory.newDocumentBuilder().parse(inputStream);
        DOMSignContext signContext = new DOMSignContext(privateKey, document.getDocumentElement());
        XMLSignature signature = this.xmlSignatureFactory.newXMLSignature(this.signedInfo, this.keyInfo);

        signature.sign(signContext);

        Document outputDocument = this.documentBuilderFactory.newDocumentBuilder().newDocument();
        DOMResult domResult = new DOMResult(outputDocument);

        TransformerFactory transformerFactory = TransformerFactory.newInstance();
View Full Code Here


                XMLSignature signature = signFactory.constructSignature(signedInfo, keyInfo, signaturePolicy.getUUID());           
                signContext.put(MessageConstants.WSS_PROCESSING_CONTEXT, context);           
                NamespaceAndPrefixMapper npMapper = new NamespaceAndPrefixMapper(context.getNamespaceContext(), context.getDisableIncPrefix());
                signContext.put(NamespaceAndPrefixMapper.NS_PREFIX_MAPPER, npMapper);           
                signContext.putNamespacePrefix(MessageConstants.DSIG_NS, MessageConstants.DSIG_PREFIX);
                signature.sign(signContext);
           
                JAXBSignatureHeaderElement jaxBSign = new JAXBSignatureHeaderElement((com.sun.xml.ws.security.opt.crypto.dsig.Signature)signature,context.getSOAPVersion());
                securityHeader.add(jaxBSign);
           
                //For SignatureConfirmation
View Full Code Here

            signContext.setURIDereferencer(DSigResolver.getInstance());
            XMLSignature signature = dsigHelper.constructSignature(signedInfo, keyInfo, signaturePolicy.getUUID());
            signContext.put(MessageConstants.WSS_PROCESSING_CONTEXT, context);
            signContext.putNamespacePrefix(MessageConstants.DSIG_NS, MessageConstants.DSIG_PREFIX);
//            XMLUtils.circumventBug2650(context.getSecurableSoapMessage().getSOAPPart());
            signature.sign(signContext);
           
            //For SignatureConfirmation
            List scList = (ArrayList)context.getExtraneousProperty("SignatureConfirmation");
            if(scList != null){
                scList.add(Base64.encode(signature.getSignatureValue().getValue()));
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.