Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/xml/crypto/dsig/DigestMethod.java
38918 views
/*1* Copyright (c) 2005, 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: DigestMethod.java,v 1.6 2005/05/10 16:03:46 mullan Exp $26*/27package javax.xml.crypto.dsig;2829import javax.xml.crypto.AlgorithmMethod;30import javax.xml.crypto.XMLStructure;31import javax.xml.crypto.dsig.spec.DigestMethodParameterSpec;32import java.security.spec.AlgorithmParameterSpec;3334/**35* A representation of the XML <code>DigestMethod</code> element as36* defined in the <a href="http://www.w3.org/TR/xmldsig-core/">37* W3C Recommendation for XML-Signature Syntax and Processing</a>.38* The XML Schema Definition is defined as:39* <p>40* <pre>41* <element name="DigestMethod" type="ds:DigestMethodType"/>42* <complexType name="DigestMethodType" mixed="true">43* <sequence>44* <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>45* <!-- (0,unbounded) elements from (1,1) namespace -->46* </sequence>47* <attribute name="Algorithm" type="anyURI" use="required"/>48* </complexType>49* </pre>50*51* A <code>DigestMethod</code> instance may be created by invoking the52* {@link XMLSignatureFactory#newDigestMethod newDigestMethod} method53* of the {@link XMLSignatureFactory} class.54*55* @author Sean Mullan56* @author JSR 105 Expert Group57* @since 1.658* @see XMLSignatureFactory#newDigestMethod(String, DigestMethodParameterSpec)59*/60public interface DigestMethod extends XMLStructure, AlgorithmMethod {6162// All methods can be found in RFC 6931.6364/**65* The <a href="http://www.w3.org/2000/09/xmldsig#sha1">66* SHA1</a> digest method algorithm URI.67*/68String SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1";6970/**71* The <a href="http://www.w3.org/2001/04/xmlenc#sha256">72* SHA256</a> digest method algorithm URI.73*/74String SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256";7576/**77* The <a href="http://www.w3.org/2001/04/xmlenc#sha512">78* SHA512</a> digest method algorithm URI.79*/80String SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512";8182/**83* The <a href="http://www.w3.org/2001/04/xmlenc#ripemd160">84* RIPEMD-160</a> digest method algorithm URI.85*/86String RIPEMD160 = "http://www.w3.org/2001/04/xmlenc#ripemd160";8788/**89* Returns the algorithm-specific input parameters associated with this90* <code>DigestMethod</code>.91*92* <p>The returned parameters can be typecast to a {@link93* DigestMethodParameterSpec} object.94*95* @return the algorithm-specific parameters (may be <code>null</code> if96* not specified)97*/98AlgorithmParameterSpec getParameterSpec();99}100101102