KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > crypto > dsig > DigestMethod


1 /*
2  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
3  */

4 /*
5  * $Id: DigestMethod.java,v 1.6 2005/05/10 16:03:46 mullan Exp $
6  */

7 package javax.xml.crypto.dsig;
8
9 import javax.xml.crypto.AlgorithmMethod;
10 import javax.xml.crypto.XMLStructure;
11 import javax.xml.crypto.dsig.spec.DigestMethodParameterSpec;
12 import java.security.spec.AlgorithmParameterSpec JavaDoc;
13
14 /**
15  * A representation of the XML <code>DigestMethod</code> element as
16  * defined in the <a HREF="http://www.w3.org/TR/xmldsig-core/">
17  * W3C Recommendation for XML-Signature Syntax and Processing</a>.
18  * The XML Schema Definition is defined as:
19  * <p>
20  * <pre>
21  * &lt;element name="DigestMethod" type="ds:DigestMethodType"/&gt;
22  * &lt;complexType name="DigestMethodType" mixed="true"&gt;
23  * &lt;sequence&gt;
24  * &lt;any namespace="##any" minOccurs="0" maxOccurs="unbounded"/&gt;
25  * &lt;!-- (0,unbounded) elements from (1,1) namespace --&gt;
26  * &lt;/sequence&gt;
27  * &lt;attribute name="Algorithm" type="anyURI" use="required"/&gt;
28  * &lt;/complexType&gt;
29  * </pre>
30  *
31  * A <code>DigestMethod</code> instance may be created by invoking the
32  * {@link XMLSignatureFactory#newDigestMethod newDigestMethod} method
33  * of the {@link XMLSignatureFactory} class.
34  *
35  * @author Sean Mullan
36  * @author JSR 105 Expert Group
37  * @since 1.6
38  * @see XMLSignatureFactory#newDigestMethod(String, DigestMethodParameterSpec)
39  */

40 public interface DigestMethod extends XMLStructure, AlgorithmMethod {
41
42     /**
43      * The <a HREF="http://www.w3.org/2000/09/xmldsig#sha1">
44      * SHA1</a> digest method algorithm URI.
45      */

46     static final String JavaDoc SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1";
47
48     /**
49      * The <a HREF="http://www.w3.org/2001/04/xmlenc#sha256">
50      * SHA256</a> digest method algorithm URI.
51      */

52     static final String JavaDoc SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256";
53
54     /**
55      * The <a HREF="http://www.w3.org/2001/04/xmlenc#sha512">
56      * SHA512</a> digest method algorithm URI.
57      */

58     static final String JavaDoc SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512";
59
60     /**
61      * The <a HREF="http://www.w3.org/2001/04/xmlenc#ripemd160">
62      * RIPEMD-160</a> digest method algorithm URI.
63      */

64     static final String JavaDoc RIPEMD160 = "http://www.w3.org/2001/04/xmlenc#ripemd160";
65
66     /**
67      * Returns the algorithm-specific input parameters associated with this
68      * <code>DigestMethod</code>.
69      *
70      * <p>The returned parameters can be typecast to a {@link
71      * DigestMethodParameterSpec} object.
72      *
73      * @return the algorithm-specific parameters (may be <code>null</code> if
74      * not specified)
75      */

76     AlgorithmParameterSpec JavaDoc getParameterSpec();
77 }
78
Popular Tags