com.sun.org.apache.xml.internal.security.transforms.params.InclusiveNamespaces Java Examples

The following examples show how to use com.sun.org.apache.xml.internal.security.transforms.params.InclusiveNamespaces. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SignedInfo.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public String getInclusiveNamespaces() {
    String c14nMethodURI = c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
    if (!(c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#") ||
        c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#WithComments"))) {
        return null;
    }

    Element inclusiveElement = XMLUtils.getNextElement(c14nMethod.getFirstChild());

    if (inclusiveElement != null) {
        try {
            String inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement,
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace
                ).getInclusiveNamespaces();
            return inclusiveNamespaces;
        } catch (XMLSecurityException e) {
            return null;
        }
    }
    return null;
}
 
Example #2
Source File: SignedInfo.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public String getInclusiveNamespaces() {
    String c14nMethodURI = c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
    if (!(c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#") ||
        c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#WithComments"))) {
        return null;
    }

    Element inclusiveElement = XMLUtils.getNextElement(c14nMethod.getFirstChild());

    if (inclusiveElement != null) {
        try {
            String inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement,
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace
                ).getInclusiveNamespaces();
            return inclusiveNamespaces;
        } catch (XMLSecurityException e) {
            return null;
        }
    }
    return null;
}
 
Example #3
Source File: SignedInfo.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public String getInclusiveNamespaces() {
    String c14nMethodURI = c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
    if (!(c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#") ||
        c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#WithComments"))) {
        return null;
    }

    Element inclusiveElement = XMLUtils.getNextElement(c14nMethod.getFirstChild());

    if (inclusiveElement != null) {
        try {
            String inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement,
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace
                ).getInclusiveNamespaces();
            return inclusiveNamespaces;
        } catch (XMLSecurityException e) {
            return null;
        }
    }
    return null;
}
 
Example #4
Source File: SignedInfo.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public String getInclusiveNamespaces() {
    String c14nMethodURI = c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
    if (!(c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#") ||
        c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#WithComments"))) {
        return null;
    }

    Element inclusiveElement = XMLUtils.getNextElement(c14nMethod.getFirstChild());

    if (inclusiveElement != null) {
        try {
            String inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement,
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace
                ).getInclusiveNamespaces();
            return inclusiveNamespaces;
        } catch (XMLSecurityException e) {
            return null;
        }
    }
    return null;
}
 
Example #5
Source File: SignedInfo.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public String getInclusiveNamespaces() {
    String c14nMethodURI = c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
    if (!(c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#") ||
        c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#WithComments"))) {
        return null;
    }

    Element inclusiveElement = XMLUtils.getNextElement(c14nMethod.getFirstChild());

    if (inclusiveElement != null) {
        try {
            String inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement,
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace
                ).getInclusiveNamespaces();
            return inclusiveNamespaces;
        } catch (XMLSecurityException e) {
            return null;
        }
    }
    return null;
}
 
Example #6
Source File: SignedInfo.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public String getInclusiveNamespaces() {
    String c14nMethodURI = c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
    if (!(c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#") ||
        c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#WithComments"))) {
        return null;
    }

    Element inclusiveElement = XMLUtils.getNextElement(c14nMethod.getFirstChild());

    if (inclusiveElement != null) {
        try {
            String inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement,
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace
                ).getInclusiveNamespaces();
            return inclusiveNamespaces;
        } catch (XMLSecurityException e) {
            return null;
        }
    }
    return null;
}
 
Example #7
Source File: SignedInfo.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public String getInclusiveNamespaces() {
    String c14nMethodURI = c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
    if (!(c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#") ||
        c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#WithComments"))) {
        return null;
    }

    Element inclusiveElement = XMLUtils.getNextElement(c14nMethod.getFirstChild());

    if (inclusiveElement != null) {
        try {
            String inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement,
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace
                ).getInclusiveNamespaces();
            return inclusiveNamespaces;
        } catch (XMLSecurityException e) {
            return null;
        }
    }
    return null;
}
 
Example #8
Source File: SignedInfo.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public String getInclusiveNamespaces() {
    String c14nMethodURI = c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
    if (!(c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#") ||
        c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#WithComments"))) {
        return null;
    }

    Element inclusiveElement = XMLUtils.getNextElement(c14nMethod.getFirstChild());

    if (inclusiveElement != null) {
        try {
            String inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement,
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace
                ).getInclusiveNamespaces();
            return inclusiveNamespaces;
        } catch (XMLSecurityException e) {
            return null;
        }
    }
    return null;
}
 
Example #9
Source File: SignedInfo.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public String getInclusiveNamespaces() {
    String c14nMethodURI = c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
    if (!(c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#") ||
        c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#WithComments"))) {
        return null;
    }

    Element inclusiveElement = XMLUtils.getNextElement(c14nMethod.getFirstChild());

    if (inclusiveElement != null) {
        try {
            String inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement,
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace
                ).getInclusiveNamespaces();
            return inclusiveNamespaces;
        } catch (XMLSecurityException e) {
            return null;
        }
    }
    return null;
}
 
Example #10
Source File: SignedInfo.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public String getInclusiveNamespaces() {
    String c14nMethodURI = c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
    if (!(c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#") ||
        c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#WithComments"))) {
        return null;
    }

    Element inclusiveElement = XMLUtils.getNextElement(c14nMethod.getFirstChild());

    if (inclusiveElement != null) {
        try {
            String inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement,
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace
                ).getInclusiveNamespaces();
            return inclusiveNamespaces;
        } catch (XMLSecurityException e) {
            return null;
        }
    }
    return null;
}
 
Example #11
Source File: SignedInfo.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public String getInclusiveNamespaces() {
    String c14nMethodURI = c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
    if (!(c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#") ||
        c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#WithComments"))) {
        return null;
    }

    Element inclusiveElement = XMLUtils.getNextElement(c14nMethod.getFirstChild());

    if (inclusiveElement != null) {
        try {
            String inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement,
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace
                ).getInclusiveNamespaces();
            return inclusiveNamespaces;
        } catch (XMLSecurityException e) {
            return null;
        }
    }
    return null;
}
 
Example #12
Source File: SignedInfo.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public String getInclusiveNamespaces() {
    String c14nMethodURI = c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
    if (!(c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#") ||
        c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#WithComments"))) {
        return null;
    }

    Element inclusiveElement = XMLUtils.getNextElement(c14nMethod.getFirstChild());

    if (inclusiveElement != null) {
        try {
            String inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement,
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace
                ).getInclusiveNamespaces();
            return inclusiveNamespaces;
        } catch (XMLSecurityException e) {
            return null;
        }
    }
    return null;
}
 
Example #13
Source File: SignedInfo.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public String getInclusiveNamespaces() {
    String c14nMethodURI = c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
    if (!(c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#") ||
        c14nMethodURI.equals("http://www.w3.org/2001/10/xml-exc-c14n#WithComments"))) {
        return null;
    }

    Element inclusiveElement = XMLUtils.getNextElement(c14nMethod.getFirstChild());

    if (inclusiveElement != null) {
        try {
            String inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement,
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace
                ).getInclusiveNamespaces();
            return inclusiveNamespaces;
        } catch (XMLSecurityException e) {
            return null;
        }
    }
    return null;
}
 
Example #14
Source File: TransformC14NExclusive.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclOmitComments c14n =
            new Canonicalizer20010315ExclOmitComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);

        XMLSignatureInput output = new XMLSignatureInput(result);
        if (os != null) {
            output.setOutputStream(os);
        }
        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #15
Source File: TransformC14NExclusiveWithComments.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()
                ).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclWithComments c14n =
            new Canonicalizer20010315ExclWithComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);
        XMLSignatureInput output = new XMLSignatureInput(result);

        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #16
Source File: TransformC14NExclusive.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclOmitComments c14n =
            new Canonicalizer20010315ExclOmitComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);

        XMLSignatureInput output = new XMLSignatureInput(result);
        if (os != null) {
            output.setOutputStream(os);
        }
        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #17
Source File: TransformC14NExclusive.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclOmitComments c14n =
            new Canonicalizer20010315ExclOmitComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);

        XMLSignatureInput output = new XMLSignatureInput(result);
        if (os != null) {
            output.setOutputStream(os);
        }
        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #18
Source File: TransformC14NExclusiveWithComments.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()
                ).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclWithComments c14n =
            new Canonicalizer20010315ExclWithComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);
        XMLSignatureInput output = new XMLSignatureInput(result);

        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #19
Source File: TransformC14NExclusive.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclOmitComments c14n =
            new Canonicalizer20010315ExclOmitComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);

        XMLSignatureInput output = new XMLSignatureInput(result);
        if (os != null) {
            output.setOutputStream(os);
        }
        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #20
Source File: TransformC14NExclusiveWithComments.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()
                ).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclWithComments c14n =
            new Canonicalizer20010315ExclWithComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);
        XMLSignatureInput output = new XMLSignatureInput(result);

        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #21
Source File: TransformC14NExclusive.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclOmitComments c14n =
            new Canonicalizer20010315ExclOmitComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);

        XMLSignatureInput output = new XMLSignatureInput(result);
        if (os != null) {
            output.setOutputStream(os);
        }
        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #22
Source File: TransformC14NExclusiveWithComments.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()
                ).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclWithComments c14n =
            new Canonicalizer20010315ExclWithComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);
        XMLSignatureInput output = new XMLSignatureInput(result);

        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #23
Source File: TransformC14NExclusiveWithComments.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()
                ).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclWithComments c14n =
            new Canonicalizer20010315ExclWithComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);
        XMLSignatureInput output = new XMLSignatureInput(result);

        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #24
Source File: TransformC14NExclusive.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclOmitComments c14n =
            new Canonicalizer20010315ExclOmitComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);

        XMLSignatureInput output = new XMLSignatureInput(result);
        if (os != null) {
            output.setOutputStream(os);
        }
        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #25
Source File: TransformC14NExclusiveWithComments.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()
                ).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclWithComments c14n =
            new Canonicalizer20010315ExclWithComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);
        XMLSignatureInput output = new XMLSignatureInput(result);

        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #26
Source File: TransformC14NExclusive.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclOmitComments c14n =
            new Canonicalizer20010315ExclOmitComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);

        XMLSignatureInput output = new XMLSignatureInput(result);
        if (os != null) {
            output.setOutputStream(os);
        }
        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #27
Source File: TransformC14NExclusive.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclOmitComments c14n =
            new Canonicalizer20010315ExclOmitComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);

        XMLSignatureInput output = new XMLSignatureInput(result);
        if (os != null) {
            output.setOutputStream(os);
        }
        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #28
Source File: TransformC14NExclusive.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclOmitComments c14n =
            new Canonicalizer20010315ExclOmitComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);

        XMLSignatureInput output = new XMLSignatureInput(result);
        if (os != null) {
            output.setOutputStream(os);
        }
        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #29
Source File: TransformC14NExclusiveWithComments.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()
                ).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclWithComments c14n =
            new Canonicalizer20010315ExclWithComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);
        XMLSignatureInput output = new XMLSignatureInput(result);

        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}
 
Example #30
Source File: TransformC14NExclusive.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected XMLSignatureInput enginePerformTransform(
    XMLSignatureInput input, OutputStream os, Transform transformObject
) throws CanonicalizationException {
    try {
        String inclusiveNamespaces = null;

        if (transformObject.length(
            InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
            InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1
        ) {
            Element inclusiveElement =
                XMLUtils.selectNode(
                    transformObject.getElement().getFirstChild(),
                    InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
                    InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
                    0
                );

            inclusiveNamespaces =
                new InclusiveNamespaces(
                    inclusiveElement, transformObject.getBaseURI()).getInclusiveNamespaces();
        }

        Canonicalizer20010315ExclOmitComments c14n =
            new Canonicalizer20010315ExclOmitComments();
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = c14n.engineCanonicalize(input, inclusiveNamespaces);

        XMLSignatureInput output = new XMLSignatureInput(result);
        if (os != null) {
            output.setOutputStream(os);
        }
        return output;
    } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
    }
}