Package javax.xml.crypto.dsig

Examples of javax.xml.crypto.dsig.XMLObject


        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


        List<XMLStructure> objectContent = new ArrayList<XMLStructure>();
        objectContent.add(manifest);

        addSignatureTime(document, objectContent);

        XMLObject xo = getSignatureFactory().newXMLObject(objectContent, objectId, null, null);
        objects.add(xo);

        Reference reference = newReference("#" + objectId, null, XML_DIGSIG_NS+"Object", null, null);
        references.add(reference);
    }
View Full Code Here

        // add XAdES ds:Object
        List<XMLStructure> xadesObjectContent = new ArrayList<XMLStructure>();
        Element qualDocElSrc = (Element)qualifyingProperties.getDomNode();
        Element qualDocEl = (Element)document.importNode(qualDocElSrc, true);
        xadesObjectContent.add(new DOMStructure(qualDocEl));
        XMLObject xadesObject = getSignatureFactory().newXMLObject(xadesObjectContent, null, null, null);
        objects.add(xadesObject);

        // add XAdES ds:Reference
        List<Transform> transforms = new ArrayList<Transform>();
        Transform exclusiveTransform = newTransform(CanonicalizationMethod.INCLUSIVE);
View Full Code Here

      @Nonnull String elementName = xmlDocument.getFirstChild().getNodeName();
      Reference ref = SIGNATURE_FACTORY.newReference( '#' + elementName, SIGNATURE_FACTORY.newDigestMethod( DigestMethod.SHA256, null ) );

      Node invoice = xmlDocument.getDocumentElement();
      XMLStructure content = new DOMStructure( invoice );
      XMLObject obj = SIGNATURE_FACTORY.newXMLObject( Collections.singletonList( content ), elementName, null, null );

      SignedInfo si = SIGNATURE_FACTORY.newSignedInfo( SIGNATURE_FACTORY.newCanonicalizationMethod( CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS, ( C14NMethodParameterSpec ) null ),
                                                       SIGNATURE_FACTORY.newSignatureMethod( SignatureMethod.RSA_SHA1, null ), Collections.singletonList( ref ) );

      XMLSignature signature = SIGNATURE_FACTORY.newXMLSignature( si, null, Collections.singletonList( obj ), null, null );
View Full Code Here

      @NotNull @NonNls String elementName = xmlDocument.getFirstChild().getNodeName();
      Reference ref = SIGNATURE_FACTORY.newReference( '#' + elementName, SIGNATURE_FACTORY.newDigestMethod( DigestMethod.SHA256, null ) );

      Node invoice = xmlDocument.getDocumentElement();
      XMLStructure content = new DOMStructure( invoice );
      XMLObject obj = SIGNATURE_FACTORY.newXMLObject( Collections.singletonList( content ), elementName, null, null );

      SignedInfo si = SIGNATURE_FACTORY.newSignedInfo( SIGNATURE_FACTORY.newCanonicalizationMethod( CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS, ( C14NMethodParameterSpec ) null ),
                                                       SIGNATURE_FACTORY.newSignatureMethod( SignatureMethod.RSA_SHA1, null ), Collections.singletonList( ref ) );

      XMLSignature signature = SIGNATURE_FACTORY.newXMLSignature( si, null, Collections.singletonList( obj ), null, null );
View Full Code Here

      @Nonnull String elementName = xmlDocument.getFirstChild().getNodeName();
      Reference ref = SIGNATURE_FACTORY.newReference( '#' + elementName, SIGNATURE_FACTORY.newDigestMethod( DigestMethod.SHA256, null ) );

      Node invoice = xmlDocument.getDocumentElement();
      XMLStructure content = new DOMStructure( invoice );
      XMLObject obj = SIGNATURE_FACTORY.newXMLObject( Collections.singletonList( content ), elementName, null, null );

      SignedInfo si = SIGNATURE_FACTORY.newSignedInfo( SIGNATURE_FACTORY.newCanonicalizationMethod( CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS, ( C14NMethodParameterSpec ) null ),
                                                       SIGNATURE_FACTORY.newSignatureMethod( SignatureMethod.RSA_SHA1, null ), Collections.singletonList( ref ) );

      XMLSignature signature = SIGNATURE_FACTORY.newXMLSignature( si, null, Collections.singletonList( obj ), null, null );
View Full Code Here

      @NotNull @NonNls String elementName = xmlDocument.getFirstChild().getNodeName();
      Reference ref = SIGNATURE_FACTORY.newReference( '#' + elementName, SIGNATURE_FACTORY.newDigestMethod( DigestMethod.SHA256, null ) );

      Node invoice = xmlDocument.getDocumentElement();
      XMLStructure content = new DOMStructure( invoice );
      XMLObject obj = SIGNATURE_FACTORY.newXMLObject( Collections.singletonList( content ), elementName, null, null );

      SignedInfo si = SIGNATURE_FACTORY.newSignedInfo( SIGNATURE_FACTORY.newCanonicalizationMethod( CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS, ( C14NMethodParameterSpec ) null ),
                                                       SIGNATURE_FACTORY.newSignatureMethod( SignatureMethod.RSA_SHA1, null ), Collections.singletonList( ref ) );

      XMLSignature signature = SIGNATURE_FACTORY.newXMLSignature( si, null, Collections.singletonList( obj ), null, null );
View Full Code Here

      @NotNull @NonNls String elementName = xmlDocument.getFirstChild().getNodeName();
      Reference ref = SIGNATURE_FACTORY.newReference( '#' + elementName, SIGNATURE_FACTORY.newDigestMethod( DigestMethod.SHA256, null ) );

      Node invoice = xmlDocument.getDocumentElement();
      XMLStructure content = new DOMStructure( invoice );
      XMLObject obj = SIGNATURE_FACTORY.newXMLObject( Collections.singletonList( content ), elementName, null, null );

      SignedInfo si = SIGNATURE_FACTORY.newSignedInfo( SIGNATURE_FACTORY.newCanonicalizationMethod( CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS, ( C14NMethodParameterSpec ) null ),
                                                       SIGNATURE_FACTORY.newSignatureMethod( SignatureMethod.RSA_SHA1, null ), Collections.singletonList( ref ) );

      XMLSignature signature = SIGNATURE_FACTORY.newXMLSignature( si, null, Collections.singletonList( obj ), null, null );
View Full Code Here

      @NotNull @NonNls String elementName = xmlDocument.getFirstChild().getNodeName();
      Reference ref = SIGNATURE_FACTORY.newReference( '#' + elementName, SIGNATURE_FACTORY.newDigestMethod( DigestMethod.SHA256, null ) );

      Node invoice = xmlDocument.getDocumentElement();
      XMLStructure content = new DOMStructure( invoice );
      XMLObject obj = SIGNATURE_FACTORY.newXMLObject( Collections.singletonList( content ), elementName, null, null );

      SignedInfo si = SIGNATURE_FACTORY.newSignedInfo( SIGNATURE_FACTORY.newCanonicalizationMethod( CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS, ( C14NMethodParameterSpec ) null ),
                                                       SIGNATURE_FACTORY.newSignatureMethod( SignatureMethod.RSA_SHA1, null ), Collections.singletonList( ref ) );

      XMLSignature signature = SIGNATURE_FACTORY.newXMLSignature( si, null, 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

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.