KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > crypto > dsig > keyinfo > X509Data


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

4 /*
5  * $Id: X509Data.java,v 1.4 2005/05/10 16:35:35 mullan Exp $
6  */

7 package javax.xml.crypto.dsig.keyinfo;
8
9 import javax.xml.crypto.XMLStructure;
10 import java.security.cert.X509CRL JavaDoc;
11 import java.util.List JavaDoc;
12
13 /**
14  * A representation of the XML <code>X509Data</code> element as defined in
15  * the <a HREF="http://www.w3.org/TR/xmldsig-core/">
16  * W3C Recommendation for XML-Signature Syntax and Processing</a>. An
17  * <code>X509Data</code> object contains one or more identifers of keys
18  * or X.509 certificates (or certificates' identifiers or a revocation list).
19  * The XML Schema Definition is defined as:
20  *
21  * <pre>
22  * &lt;element name="X509Data" type="ds:X509DataType"/&gt;
23  * &lt;complexType name="X509DataType"&gt;
24  * &lt;sequence maxOccurs="unbounded"&gt;
25  * &lt;choice&gt;
26  * &lt;element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/&gt;
27  * &lt;element name="X509SKI" type="base64Binary"/&gt;
28  * &lt;element name="X509SubjectName" type="string"/&gt;
29  * &lt;element name="X509Certificate" type="base64Binary"/&gt;
30  * &lt;element name="X509CRL" type="base64Binary"/&gt;
31  * &lt;any namespace="##other" processContents="lax"/&gt;
32  * &lt;/choice&gt;
33  * &lt;/sequence&gt;
34  * &lt;/complexType&gt;
35  *
36  * &lt;complexType name="X509IssuerSerialType"&gt;
37  * &lt;sequence&gt;
38  * &lt;element name="X509IssuerName" type="string"/&gt;
39  * &lt;element name="X509SerialNumber" type="integer"/&gt;
40  * &lt;/sequence&gt;
41  * &lt;/complexType&gt;
42  * </pre>
43  *
44  * An <code>X509Data</code> instance may be created by invoking the
45  * {@link KeyInfoFactory#newX509Data newX509Data} methods of the
46  * {@link KeyInfoFactory} class and passing it a list of one or more
47  * {@link XMLStructure}s representing X.509 content; for example:
48  * <pre>
49  * KeyInfoFactory factory = KeyInfoFactory.getInstance("DOM");
50  * X509Data x509Data = factory.newX509Data
51  * (Collections.singletonList("cn=Alice"));
52  * </pre>
53  *
54  * @author Sean Mullan
55  * @author JSR 105 Expert Group
56  * @since 1.6
57  * @see KeyInfoFactory#newX509Data(List)
58  */

59 //@@@ check for illegal combinations of data violating MUSTs in W3c spec
60
public interface X509Data extends XMLStructure {
61
62     /**
63      * URI identifying the X509Data KeyInfo type:
64      * http://www.w3.org/2000/09/xmldsig#X509Data. This can be specified as
65      * the value of the <code>type</code> parameter of the
66      * {@link RetrievalMethod} class to describe a remote
67      * <code>X509Data</code> structure.
68      */

69     final static String JavaDoc TYPE = "http://www.w3.org/2000/09/xmldsig#X509Data";
70
71     /**
72      * URI identifying the binary (ASN.1 DER) X.509 Certificate KeyInfo type:
73      * http://www.w3.org/2000/09/xmldsig#rawX509Certificate. This can be
74      * specified as the value of the <code>type</code> parameter of the
75      * {@link RetrievalMethod} class to describe a remote X509 Certificate.
76      */

77     final static String JavaDoc RAW_X509_CERTIFICATE_TYPE =
78         "http://www.w3.org/2000/09/xmldsig#rawX509Certificate";
79
80     /**
81      * Returns an {@link java.util.Collections#unmodifiableList unmodifiable
82      * list} of the content in this <code>X509Data</code>. Valid types are
83      * {@link String} (subject names), <code>byte[]</code> (subject key ids),
84      * {@link java.security.cert.X509Certificate}, {@link X509CRL},
85      * or {@link XMLStructure} ({@link X509IssuerSerial}
86      * objects or elements from an external namespace).
87      *
88      * @return an unmodifiable list of the content in this <code>X509Data</code>
89      * (never <code>null</code> or empty)
90      */

91     List JavaDoc getContent();
92 }
93
Popular Tags