Package javax.xml.crypto.dsig

Examples of javax.xml.crypto.dsig.XMLObject


        Document doc = db.newDocument();
        // create Objects
        Element webElem = doc.createElementNS(null, "Web");
        Text text = doc.createTextNode("up up and away");
        webElem.appendChild(text);
        XMLObject obj = fac.newXMLObject(Collections.singletonList
                                         (new DOMStructure(webElem)), "DSig.Object_1", "text/xml", null);

        // create XMLSignature
        XMLSignature sig = fac.newXMLSignature
        (si, ki, Collections.singletonList(obj), null, null);
View Full Code Here


        Document doc = db.newDocument();
        // create Objects
        Element webElem = doc.createElementNS(null, "Web");
        Text text = doc.createTextNode("up up and away");
        webElem.appendChild(text);
        XMLObject obj = fac.newXMLObject(Collections.singletonList
                                         (new DOMStructure(webElem)), "DSig.Object_1", "text/xml", null);

        // create XMLSignature
        XMLSignature sig = fac.newXMLSignature
        (si, ki, Collections.singletonList(obj), null, null);
View Full Code Here

        BSPEnforcer bspEnforcer
    ) throws WSSecurityException {
        // Check for Manifests
        for (Object object : xmlSignature.getObjects()) {
            if (object instanceof XMLObject) {
                XMLObject xmlObject = (XMLObject)object;
                for (Object xmlStructure : xmlObject.getContent()) {
                    if (xmlStructure instanceof Manifest) {
                        bspEnforcer.handleBSPRule(BSPRule.R5403);
                    }
                }
            }
View Full Code Here

        // enveloping signature --> add additional object
        final String objectId = getConfiguration().getContentObjectId();
        LOG.debug("Object Content Id {}", objectId);

        XMLObject obj = createXMLObject(input.getSignatureFactory(), input.getMessageBodyNode(), objectId);
        if (properties == null || properties.getObjects() == null || properties.getObjects().isEmpty()) {
            return Collections.singletonList(obj);
        }
        List<XMLObject> result = new ArrayList<XMLObject>(properties.getObjects().size() + 1);
        result.add(obj);
View Full Code Here

        }

        if (referencedObjects.size() > 1) {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < referencedObjects.size(); i++) {
                XMLObject xmlOb = referencedObjects.get(i);
                sb.append(xmlOb.getId());
                if (i < referencedObjects.size() - 1) {
                    sb.append(", ");
                }
            }
            throw new XmlSignatureException(String.format(
View Full Code Here

        for (Reference ref : relevantReferences) {
            String refUri = getSameDocumentReferenceUri(ref);
            if (refUri == null) {
                continue;
            }
            XMLObject referencedOb = getReferencedObject(relevantObjects, refUri);
            if (referencedOb != null) {
                referencedObjects.add(referencedOb);
                continue;
            }
            // content could also be indirectly referenced via manifest
View Full Code Here

        for (Reference manifestRef : (List<Reference>) manifest.getReferences()) {
            String manifestRefUri = getSameDocumentReferenceUri(manifestRef);
            if (manifestRefUri == null) {
                continue;
            }
            XMLObject manifestReferencedOb = getReferencedObject(allObjects, manifestRefUri);
            if (manifestReferencedOb != null) {
                referencedObjects.add(manifestReferencedOb);
            }
        }
    }
View Full Code Here

        XMLSignature xmlSignature
    ) throws WSSecurityException {
        // Check for Manifests
        for (Object object : xmlSignature.getObjects()) {
            if (object instanceof XMLObject) {
                XMLObject xmlObject = (XMLObject)object;
                for (Object xmlStructure : xmlObject.getContent()) {
                    if (xmlStructure instanceof Manifest) {
                        throw new WSSecurityException(
                            WSSecurityException.INVALID_SECURITY, "R5403"
                        );
                    }
View Full Code Here

        }

        if (referencedObjects.size() > 1) {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < referencedObjects.size(); i++) {
                XMLObject xmlOb = referencedObjects.get(i);
                sb.append(xmlOb.getId());
                if (i < referencedObjects.size() - 1) {
                    sb.append(", ");
                }
            }
            throw new XmlSignatureException(String.format(
View Full Code Here

        for (Reference ref : relevantReferences) {
            String refUri = getSameDocumentReferenceUri(ref);
            if (refUri == null) {
                continue;
            }
            XMLObject referencedOb = getReferencedObject(relevantObjects, refUri);
            if (referencedOb != null) {
                referencedObjects.add(referencedOb);
                continue;
            }
            // content could also be indirectly referenced via manifest
View Full Code Here

TOP

Related Classes of javax.xml.crypto.dsig.XMLObject

Copyright © 2018 www.massapicom. 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.