Path: blob/master/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/CanonicalizationMethod.java
41161 views
/*1* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/24/*25* $Id: CanonicalizationMethod.java,v 1.6 2005/05/10 16:03:45 mullan Exp $26*/27package javax.xml.crypto.dsig;2829import java.security.spec.AlgorithmParameterSpec;30import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;3132/**33* A representation of the XML <code>CanonicalizationMethod</code>34* element as defined in the35* <a href="http://www.w3.org/TR/xmldsig-core/">36* W3C Recommendation for XML-Signature Syntax and Processing</a>. The XML37* Schema Definition is defined as:38* <pre>39* <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>40* <complexType name="CanonicalizationMethodType" mixed="true">41* <sequence>42* <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>43* <!-- (0,unbounded) elements from (1,1) namespace -->44* </sequence>45* <attribute name="Algorithm" type="anyURI" use="required"/>46* </complexType>47* </pre>48*49* A <code>CanonicalizationMethod</code> instance may be created by invoking50* the {@link XMLSignatureFactory#newCanonicalizationMethod51* newCanonicalizationMethod} method of the {@link XMLSignatureFactory} class.52*53* @author Sean Mullan54* @author JSR 105 Expert Group55* @since 1.656* @see XMLSignatureFactory#newCanonicalizationMethod(String, C14NMethodParameterSpec)57*/58public interface CanonicalizationMethod extends Transform {5960/**61* The <a href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315">Canonical62* XML (without comments)</a> canonicalization method algorithm URI.63*/64static final String INCLUSIVE =65"http://www.w3.org/TR/2001/REC-xml-c14n-20010315";6667/**68* The69* <a href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments">70* Canonical XML with comments</a> canonicalization method algorithm URI.71*/72static final String INCLUSIVE_WITH_COMMENTS =73"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments";7475/**76* The <a href="http://www.w3.org/2001/10/xml-exc-c14n#">Exclusive77* Canonical XML (without comments)</a> canonicalization method algorithm78* URI.79*/80static final String EXCLUSIVE =81"http://www.w3.org/2001/10/xml-exc-c14n#";8283/**84* The <a href="http://www.w3.org/2001/10/xml-exc-c14n#WithComments">85* Exclusive Canonical XML with comments</a> canonicalization method86* algorithm URI.87*/88static final String EXCLUSIVE_WITH_COMMENTS =89"http://www.w3.org/2001/10/xml-exc-c14n#WithComments";9091/**92* The <a href="https://www.w3.org/TR/xml-c14n11/">Canonical XML 1.193* (without comments)</a> canonicalization method algorithm URI.94*95* @since 1396*/97static final String INCLUSIVE_11 = "http://www.w3.org/2006/12/xml-c14n11";9899/**100* The <a href="https://www.w3.org/TR/xml-c14n11/#WithComments">101* Canonical XML 1.1 with comments</a> canonicalization method algorithm102* URI.103*104* @since 13105*/106static final String INCLUSIVE_11_WITH_COMMENTS =107"http://www.w3.org/2006/12/xml-c14n11#WithComments";108109/**110* Returns the algorithm-specific input parameters associated with this111* <code>CanonicalizationMethod</code>.112*113* <p>The returned parameters can be typecast to a114* {@link C14NMethodParameterSpec} object.115*116* @return the algorithm-specific input parameters (may be117* <code>null</code> if not specified)118*/119AlgorithmParameterSpec getParameterSpec();120}121122123