• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java InvalidCanonicalizerException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.xml.security.c14n.InvalidCanonicalizerException的典型用法代码示例。如果您正苦于以下问题:Java InvalidCanonicalizerException类的具体用法?Java InvalidCanonicalizerException怎么用?Java InvalidCanonicalizerException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InvalidCanonicalizerException类属于org.apache.xml.security.c14n包,在下文中一共展示了InvalidCanonicalizerException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: transform

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
@Override
public Data transform(Data data, XMLCryptoContext xc)
    throws TransformException
{
    // ignore comments if dereferencing same-document URI that require
    // you to omit comments, even if the Transform says otherwise -
    // this is to be compliant with section 4.3.3.3 of W3C Rec.
    if (data instanceof DOMSubTreeData) {
        DOMSubTreeData subTree = (DOMSubTreeData)data;
        if (subTree.excludeComments()) {
            try {
                apacheCanonicalizer = Canonicalizer.getInstance
                    (CanonicalizationMethod.EXCLUSIVE);
                boolean secVal = Utils.secureValidation(xc);
                apacheCanonicalizer.setSecureValidation(secVal);
            } catch (InvalidCanonicalizerException ice) {
                throw new TransformException
                    ("Couldn't find Canonicalizer for: " +
                     CanonicalizationMethod.EXCLUSIVE + ": " +
                     ice.getMessage(), ice);
            }
        }
    }

    return canonicalize(data, xc);
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:27,代码来源:DOMExcC14NMethod.java


示例2: transform

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
@Override
public Data transform(Data data, XMLCryptoContext xc)
    throws TransformException {

    // ignore comments if dereferencing same-document URI that requires
    // you to omit comments, even if the Transform says otherwise -
    // this is to be compliant with section 4.3.3.3 of W3C Rec.
    if (data instanceof DOMSubTreeData) {
        DOMSubTreeData subTree = (DOMSubTreeData) data;
        if (subTree.excludeComments()) {
            try {
                apacheCanonicalizer = Canonicalizer.getInstance
                    (CanonicalizationMethod.INCLUSIVE);
                boolean secVal = Utils.secureValidation(xc);
                apacheCanonicalizer.setSecureValidation(secVal);
            } catch (InvalidCanonicalizerException ice) {
                throw new TransformException
                    ("Couldn't find Canonicalizer for: " +
                     CanonicalizationMethod.INCLUSIVE + ": " +
                     ice.getMessage(), ice);
            }
        }
    }

    return canonicalize(data, xc);
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:27,代码来源:DOMCanonicalXMLC14NMethod.java


示例3: transform

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
@Override
public Data transform(Data data, XMLCryptoContext xc)
    throws TransformException {

    // ignore comments if dereferencing same-document URI that requires
    // you to omit comments, even if the Transform says otherwise -
    // this is to be compliant with section 4.3.3.3 of W3C Rec.
    if (data instanceof DOMSubTreeData) {
        DOMSubTreeData subTree = (DOMSubTreeData) data;
        if (subTree.excludeComments()) {
            try {
                apacheCanonicalizer = Canonicalizer.getInstance(C14N_11);
                boolean secVal = Utils.secureValidation(xc);
                apacheCanonicalizer.setSecureValidation(secVal);
            } catch (InvalidCanonicalizerException ice) {
                throw new TransformException
                    ("Couldn't find Canonicalizer for: " +
                     C14N_11 + ": " + ice.getMessage(), ice);
            }
        }
    }

    return canonicalize(data, xc);
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:25,代码来源:DOMCanonicalXMLC14N11Method.java


示例4: getCanonicalizedOctetStream

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * Returns getCanonicalizedOctetStream
 *
 * @return the canonicalization result octet stream of <code>SignedInfo</code> element
 * @throws CanonicalizationException
 * @throws InvalidCanonicalizerException
 * @throws XMLSecurityException
 */
public byte[] getCanonicalizedOctetStream()
    throws CanonicalizationException, InvalidCanonicalizerException, XMLSecurityException {
    if (this.c14nizedBytes == null) {
        Canonicalizer c14nizer =
            Canonicalizer.getInstance(this.getCanonicalizationMethodURI());
        c14nizer.setSecureValidation(isSecureValidation());

        String inclusiveNamespaces = this.getInclusiveNamespaces();
        if (inclusiveNamespaces == null) {
            this.c14nizedBytes = c14nizer.canonicalizeSubtree(getElement());
        } else {
            this.c14nizedBytes = c14nizer.canonicalizeSubtree(getElement(), inclusiveNamespaces);
        }
    }

    // make defensive copy
    return this.c14nizedBytes.clone();
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:27,代码来源:SignedInfo.java


示例5: signInOctetStream

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * Output the C14n stream to the given OutputStream.
 * @param os
 * @throws CanonicalizationException
 * @throws InvalidCanonicalizerException
 * @throws XMLSecurityException
 */
public void signInOctetStream(OutputStream os)
    throws CanonicalizationException, InvalidCanonicalizerException, XMLSecurityException {
    if (this.c14nizedBytes == null) {
        Canonicalizer c14nizer =
            Canonicalizer.getInstance(this.getCanonicalizationMethodURI());
        c14nizer.setSecureValidation(isSecureValidation());
        c14nizer.setWriter(os);
        String inclusiveNamespaces = this.getInclusiveNamespaces();

        if (inclusiveNamespaces == null) {
            c14nizer.canonicalizeSubtree(getElement());
        } else {
            c14nizer.canonicalizeSubtree(getElement(), inclusiveNamespaces);
        }
    } else {
        try {
            os.write(this.c14nizedBytes);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:30,代码来源:SignedInfo.java


示例6: testSetOctetStreamGetOctetStream

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
@org.junit.Test
public void testSetOctetStreamGetOctetStream()
    throws IOException, CanonicalizationException, InvalidCanonicalizerException {
    InputStream inputStream =
        new ByteArrayInputStream(_octetStreamTextInput.getBytes("UTF-8"));
    XMLSignatureInput input = new XMLSignatureInput(inputStream);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    InputStream res = input.getOctetStream();
    int off = 0;

    while (res.available() > 0) {
        byte array[] = new byte[1024];
        int len = res.read(array);

        baos.write(array, off, len);
        off += len;
    }

    byte resBytes[] = baos.toByteArray();
    String resString = new String(resBytes, "UTF-8");

    assertTrue(resString.equals(_octetStreamTextInput));
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:24,代码来源:XMLSignatureInputTest.java


示例7: test221

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * Method test221
 *
 * @throws CanonicalizationException
 * @throws FileNotFoundException
 * @throws IOException
 * @throws InvalidCanonicalizerException
 * @throws ParserConfigurationException
 * @throws SAXException
 * @throws TransformerException
 * @throws XMLSecurityException
 * @throws XMLSignatureException
 */
@org.junit.Test
public void test221()
    throws IOException, FileNotFoundException, SAXException,
    ParserConfigurationException, CanonicalizationException,
    InvalidCanonicalizerException, TransformerException,
    XMLSignatureException, XMLSecurityException {

    Document doc =
        this.db.parse(
            getAbsolutePath("src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_1.xml")
        );
    Node root = doc.getElementsByTagNameNS("http://example.net", "elem2").item(0);
    Canonicalizer20010315 c = new Canonicalizer20010315WithComments();
    byte[] reference = JavaUtils.getBytesFromFile(getAbsolutePath(
        "src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_1_c14nized.xml"));
    byte[] result = c.engineCanonicalizeSubTree(root);
    boolean equals = java.security.MessageDigest.isEqual(reference, result);

    assertTrue(equals);
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:34,代码来源:Canonicalizer20010315ExclusiveTest.java


示例8: test222

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * Method test222
 *
 * @throws CanonicalizationException
 * @throws FileNotFoundException
 * @throws IOException
 * @throws InvalidCanonicalizerException
 * @throws ParserConfigurationException
 * @throws SAXException
 * @throws TransformerException
 * @throws XMLSecurityException
 * @throws XMLSignatureException
 */
@org.junit.Test
public void test222()
    throws IOException, FileNotFoundException, SAXException,
    ParserConfigurationException, CanonicalizationException,
    InvalidCanonicalizerException, TransformerException,
    XMLSignatureException, XMLSecurityException {
    Document doc =
        this.db.parse(getAbsolutePath(
            "src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_2.xml")
        );
    Node root = doc.getElementsByTagNameNS("http://example.net", "elem2").item(0);
    Canonicalizer20010315 c = new Canonicalizer20010315WithComments();
    byte[] reference = JavaUtils.getBytesFromFile(getAbsolutePath(
        "src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_2_c14nized.xml"));
    byte[] result = c.engineCanonicalizeSubTree(root);
    boolean equals = java.security.MessageDigest.isEqual(reference, result);

    assertTrue(equals);
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:33,代码来源:Canonicalizer20010315ExclusiveTest.java


示例9: test221excl

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * Method test221excl
 *
 * @throws CanonicalizationException
 * @throws FileNotFoundException
 * @throws IOException
 * @throws InvalidCanonicalizerException
 * @throws ParserConfigurationException
 * @throws SAXException
 * @throws TransformerException
 * @throws XMLSecurityException
 * @throws XMLSignatureException
 */
@org.junit.Test
public void test221excl()
    throws IOException, FileNotFoundException, SAXException,
    ParserConfigurationException, CanonicalizationException,
    InvalidCanonicalizerException, TransformerException,
    XMLSignatureException, XMLSecurityException {
    Document doc =
        this.db.parse(getAbsolutePath(
            "src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_1.xml"));
    Node root = doc.getElementsByTagNameNS("http://example.net", "elem2").item(0);
    Canonicalizer20010315Excl c = new Canonicalizer20010315ExclWithComments();
    byte[] reference = JavaUtils.getBytesFromFile(getAbsolutePath(
        "src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_c14nized_exclusive.xml"));
    byte[] result = c.engineCanonicalizeSubTree(root);
    boolean equals = java.security.MessageDigest.isEqual(reference, result);

    assertTrue(equals);
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:32,代码来源:Canonicalizer20010315ExclusiveTest.java


示例10: test222excl

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * Method test222excl
 *
 * @throws CanonicalizationException
 * @throws FileNotFoundException
 * @throws IOException
 * @throws InvalidCanonicalizerException
 * @throws ParserConfigurationException
 * @throws SAXException
 * @throws TransformerException
 * @throws XMLSecurityException
 * @throws XMLSignatureException
 */
@org.junit.Test
public void test222excl()
    throws IOException, FileNotFoundException, SAXException,
    ParserConfigurationException, CanonicalizationException,
    InvalidCanonicalizerException, TransformerException,
    XMLSignatureException, XMLSecurityException {
    Document doc =
        this.db.parse(getAbsolutePath(
            "src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_2.xml"));
    Node root = doc.getElementsByTagNameNS("http://example.net", "elem2").item(0);
    Canonicalizer20010315Excl c = new Canonicalizer20010315ExclWithComments();
    byte[] reference = JavaUtils.getBytesFromFile(getAbsolutePath(
        "src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_c14nized_exclusive.xml") );
    byte[] result = c.engineCanonicalizeSubTree(root);
    boolean equals = java.security.MessageDigest.isEqual(reference, result);

    assertTrue(equals);
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:32,代码来源:Canonicalizer20010315ExclusiveTest.java


示例11: test31withCommentsSubtree

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * 3.1 PIs, Comments, and Outside of Document Element
 *
 * @throws CanonicalizationException
 * @throws FileNotFoundException
 * @throws IOException
 * @throws InvalidCanonicalizerException
 * @throws ParserConfigurationException
 * @throws SAXException
 * @throws TransformerException
 * @throws XPathExpressionException
 */
@org.junit.Test
public void test31withCommentsSubtree()
    throws IOException, FileNotFoundException, SAXException,
    ParserConfigurationException, CanonicalizationException,
    InvalidCanonicalizerException, TransformerException, XPathExpressionException {
    String descri =
        "3.1: PIs, Comments, and Outside of Document Element. (commented)";

    String fileIn = prefix + "in/31_input.xml";
    String fileRef = prefix + "in/31_c14n-comments.xml";
    String fileOut = prefix + "out/xpath_31_output-comments.xml";
    String c14nURI = Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS;
    boolean validating = true;
    String xpath = null;

    assertTrue(descri,
               c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, validating, xpath));
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:31,代码来源:Canonicalizer20010315Test.java


示例12: test31withCommentsSubset

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * 3.1 PIs, Comments, and Outside of Document Element
 *
 * @throws CanonicalizationException
 * @throws FileNotFoundException
 * @throws IOException
 * @throws InvalidCanonicalizerException
 * @throws ParserConfigurationException
 * @throws SAXException
 * @throws TransformerException
 * @throws XPathExpressionException
 */
@org.junit.Test
public void test31withCommentsSubset()
    throws IOException, FileNotFoundException, SAXException,
    ParserConfigurationException, CanonicalizationException,
    InvalidCanonicalizerException, TransformerException, XPathExpressionException {
    String descri =
        "3.1: PIs, Comments, and Outside of Document Element. (commented)";

    String fileIn = prefix + "in/31_input.xml";
    String fileRef = prefix + "in/31_c14n-comments.xml";
    String fileOut = prefix + "out/xpath_31_output-comments.xml";
    String c14nURI = Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS;
    boolean validating = true;
    String xpath = Canonicalizer.XPATH_C14N_WITH_COMMENTS_SINGLE_NODE;

    assertTrue(descri,
               c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, validating, xpath));
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:31,代码来源:Canonicalizer20010315Test.java


示例13: test31subtree

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * 3.1 PIs, Comments, and Outside of Document Element
 *
 * @throws CanonicalizationException
 * @throws FileNotFoundException
 * @throws IOException
 * @throws InvalidCanonicalizerException
 * @throws ParserConfigurationException
 * @throws SAXException
 * @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-OutsideDoc">the example from the spec</A>
 * @throws TransformerException
 * @throws XPathExpressionException
 */
@org.junit.Test
public void test31subtree()
    throws IOException, FileNotFoundException, SAXException,
    ParserConfigurationException, CanonicalizationException,
    InvalidCanonicalizerException, TransformerException, XPathExpressionException {
    String descri =
        "3.1: PIs, Comments, and Outside of Document Element. (uncommented)";
    String fileIn = prefix + "in/31_input.xml";
    String fileRef = prefix + "in/31_c14n.xml";
    String fileOut = prefix + "out/xpath_31_output.xml";
    String c14nURI = Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS;
    boolean validating = true;
    String xpath = null;

    assertTrue(descri,
               c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, validating, xpath));
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:31,代码来源:Canonicalizer20010315Test.java


示例14: test31subset

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * 3.1 PIs, Comments, and Outside of Document Element
 *
 * @throws CanonicalizationException
 * @throws FileNotFoundException
 * @throws IOException
 * @throws InvalidCanonicalizerException
 * @throws ParserConfigurationException
 * @throws SAXException
 * @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-OutsideDoc">the example from the spec</A>
 * @throws TransformerException
 * @throws XPathExpressionException
 */
@org.junit.Test
public void test31subset()
    throws IOException, FileNotFoundException, SAXException,
    ParserConfigurationException, CanonicalizationException,
    InvalidCanonicalizerException, TransformerException, XPathExpressionException {

    String descri =
        "3.1: PIs, Comments, and Outside of Document Element. (uncommented)";
    String fileIn = prefix + "in/31_input.xml";
    String fileRef = prefix + "in/31_c14n.xml";
    String fileOut = prefix + "out/xpath_31_output.xml";
    String c14nURI = Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS;
    boolean validating = true;
    String xpath = Canonicalizer.XPATH_C14N_WITH_COMMENTS_SINGLE_NODE;

    assertTrue(descri,
               c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, validating, xpath));
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:32,代码来源:Canonicalizer20010315Test.java


示例15: test32subtree

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * 3.2 Whitespace in Document Content
 *
 * @throws CanonicalizationException
 * @throws FileNotFoundException
 * @throws IOException
 * @throws InvalidCanonicalizerException
 * @throws ParserConfigurationException
 * @throws SAXException
 * @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-WhitespaceInContent">the example from the spec</A>
 * @throws TransformerException
 * @throws XPathExpressionException
 */
@org.junit.Test
public void test32subtree()
    throws IOException, FileNotFoundException, SAXException,
    ParserConfigurationException, CanonicalizationException,
    InvalidCanonicalizerException, TransformerException, XPathExpressionException {
    String descri = "3.2 Whitespace in Document Content. (uncommented)";
    String fileIn = prefix + "in/32_input.xml";
    String fileRef = prefix + "in/32_c14n.xml";
    String fileOut = prefix + "out/xpath_32_output.xml";
    String c14nURI = Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS;
    boolean validating = true;
    String xpath = null;

    assertTrue(descri,
               c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, validating, xpath));
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:30,代码来源:Canonicalizer20010315Test.java


示例16: test32subset

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * 3.2 Whitespace in Document Content
 *
 * @throws CanonicalizationException
 * @throws FileNotFoundException
 * @throws IOException
 * @throws InvalidCanonicalizerException
 * @throws ParserConfigurationException
 * @throws SAXException
 * @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-WhitespaceInContent">the example from the spec</A>
 * @throws TransformerException
 * @throws XPathExpressionException
 */
@org.junit.Test
public void test32subset()
    throws IOException, FileNotFoundException, SAXException,
    ParserConfigurationException, CanonicalizationException,
    InvalidCanonicalizerException, TransformerException, XPathExpressionException {
    String descri = "3.2 Whitespace in Document Content. (uncommented)";
    String fileIn = prefix + "in/32_input.xml";
    String fileRef = prefix + "in/32_c14n.xml";
    String fileOut = prefix + "out/xpath_32_output.xml";
    String c14nURI = Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS;
    boolean validating = true;
    String xpath = Canonicalizer.XPATH_C14N_WITH_COMMENTS_SINGLE_NODE;

    assertTrue(descri,
               c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, validating, xpath));
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:30,代码来源:Canonicalizer20010315Test.java


示例17: test33subtree

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * 3.3 Start and End Tags
 *
 * @throws CanonicalizationException
 * @throws FileNotFoundException
 * @throws IOException
 * @throws InvalidCanonicalizerException
 * @throws ParserConfigurationException
 * @throws SAXException
 * @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-SETags">the example from the spec</A>
 * @throws TransformerException
 * @throws XPathExpressionException
 */
@org.junit.Test
public void test33subtree()
    throws IOException, FileNotFoundException, SAXException,
    ParserConfigurationException, CanonicalizationException,
    InvalidCanonicalizerException, TransformerException, XPathExpressionException {
    String descri = "3.3 Start and End Tags. (uncommented)";
    String fileIn = prefix + "in/33_input.xml";
    String fileRef = prefix + "in/33_c14n.xml";
    String fileOut = prefix + "out/xpath_33_output.xml";
    String c14nURI = Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS;
    boolean validating = true;
    String xpath = null;    // Canonicalizer.XPATH_C14N_OMIT_COMMENTS_SINGLE_NODE;

    assertTrue(descri,
               c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, validating, xpath));
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:30,代码来源:Canonicalizer20010315Test.java


示例18: test33subset

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
@org.junit.Test
public void test33subset()
    throws IOException, FileNotFoundException, SAXException,
    ParserConfigurationException, CanonicalizationException,
    InvalidCanonicalizerException, TransformerException, XPathExpressionException {
    String descri = "3.3 Start and End Tags. (uncommented)";
    String fileIn = prefix + "in/33_input.xml";
    String fileRef = prefix + "in/33_c14n.xml";
    String fileOut = prefix + "out/xpath_33_output.xml";
    String c14nURI = Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS;
    boolean validating = true;
    String xpath = Canonicalizer.XPATH_C14N_WITH_COMMENTS_SINGLE_NODE;

    assertTrue(descri,
               c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, validating, xpath));
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:17,代码来源:Canonicalizer20010315Test.java


示例19: test34

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * 3.4 Character Modifications and Character References
 *
 * @throws CanonicalizationException
 * @throws FileNotFoundException
 * @throws IOException
 * @throws InvalidCanonicalizerException
 * @throws ParserConfigurationException
 * @throws SAXException
 * @see #test34validatingParser
 * @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-Chars">the example from the spec</A>
 * @throws TransformerException
 * @throws XPathExpressionException
 */
@org.junit.Test
public void test34()
    throws IOException, FileNotFoundException, SAXException,
    ParserConfigurationException, CanonicalizationException,
    InvalidCanonicalizerException, TransformerException, XPathExpressionException {
    String descri =
        "3.4 Character Modifications and Character References. (uncommented)";
    String fileIn = prefix + "in/34_input.xml";
    String fileRef = prefix + "in/34_c14n.xml";
    String fileOut = prefix + "out/xpath_34_output.xml";
    String c14nURI = Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS;
    boolean validating = false;
    String xpath = null;

    assertTrue(descri,
               c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, validating, xpath));
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:32,代码来源:Canonicalizer20010315Test.java


示例20: test35subtree

import org.apache.xml.security.c14n.InvalidCanonicalizerException; //导入依赖的package包/类
/**
 * 3.5 Entity References
 *
 * @throws CanonicalizationException
 * @throws FileNotFoundException
 * @throws IOException
 * @throws InvalidCanonicalizerException
 * @throws ParserConfigurationException
 * @throws SAXException
 * @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-Entities">the example from the spec</A>
 * @throws TransformerException
 * @throws XPathExpressionException
 */
@org.junit.Test
public void test35subtree()
    throws IOException, FileNotFoundException, SAXException,
    ParserConfigurationException, CanonicalizationException,
    InvalidCanonicalizerException, TransformerException, XPathExpressionException {
    String descri = "3.5 Entity References. (uncommented)";
    String fileIn = prefix + "in/35_input.xml";
    String fileRef = prefix + "in/35_c14n.xml";
    String fileOut = prefix + "out/xpath_35_output.xml";
    String c14nURI = Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS;
    boolean validating = true;
    String xpath = null;

    assertTrue(descri,
               c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, validating, xpath));
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:30,代码来源:Canonicalizer20010315Test.java



注:本文中的org.apache.xml.security.c14n.InvalidCanonicalizerException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SegmentTabLayout类代码示例发布时间:2022-05-22
下一篇:
Java ValueReference类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap