KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

7 package javax.xml.crypto.dsig.keyinfo;
8
9 import java.util.Collections JavaDoc;
10 import java.util.List JavaDoc;
11 import javax.xml.crypto.XMLStructure;
12
13 /**
14  * A representation of the XML <code>PGPData</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>. A
17  * <code>PGPData</code> object is used to convey information related to
18  * PGP public key pairs and signatures on such keys. The XML Schema Definition
19  * is defined as:
20  *
21  * <pre>
22  * &lt;element name="PGPData" type="ds:PGPDataType"/&gt;
23  * &lt;complexType name="PGPDataType"&gt;
24  * &lt;choice&gt;
25  * &lt;sequence&gt;
26  * &lt;element name="PGPKeyID" type="base64Binary"/&gt;
27  * &lt;element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/&gt;
28  * &lt;any namespace="##other" processContents="lax" minOccurs="0"
29  * maxOccurs="unbounded"/&gt;
30  * &lt;/sequence&gt;
31  * &lt;sequence&gt;
32  * &lt;element name="PGPKeyPacket" type="base64Binary"/&gt;
33  * &lt;any namespace="##other" processContents="lax" minOccurs="0"
34  * maxOccurs="unbounded"/&gt;
35  * &lt;/sequence&gt;
36  * &lt;/choice&gt;
37  * &lt;/complexType&gt;
38  * </pre>
39  *
40  * A <code>PGPData</code> instance may be created by invoking one of the
41  * {@link KeyInfoFactory#newPGPData newPGPData} methods of the {@link
42  * KeyInfoFactory} class, and passing it
43  * <code>byte</code> arrays representing the contents of the PGP public key
44  * identifier and/or PGP key material packet, and an optional list of
45  * elements from an external namespace.
46  *
47  * @author Sean Mullan
48  * @author JSR 105 Expert Group
49  * @since 1.6
50  * @see KeyInfoFactory#newPGPData(byte[])
51  * @see KeyInfoFactory#newPGPData(byte[], byte[], List)
52  * @see KeyInfoFactory#newPGPData(byte[], List)
53  */

54 public interface PGPData extends XMLStructure {
55
56     /**
57      * URI identifying the PGPData KeyInfo type:
58      * http://www.w3.org/2000/09/xmldsig#PGPData. This can be specified as the
59      * value of the <code>type</code> parameter of the {@link RetrievalMethod}
60      * class to describe a remote <code>PGPData</code> structure.
61      */

62     final static String JavaDoc TYPE = "http://www.w3.org/2000/09/xmldsig#PGPData";
63
64     /**
65      * Returns the PGP public key identifier of this <code>PGPData</code> as
66      * defined in <a HREF="http://www.ietf.org/rfc/rfc2440.txt">RFC 2440</a>,
67      * section 11.2.
68      *
69      * @return the PGP public key identifier (may be <code>null</code> if
70      * not specified). Each invocation of this method returns a new clone
71      * to protect against subsequent modification.
72      */

73     byte[] getKeyId();
74
75     /**
76      * Returns the PGP key material packet of this <code>PGPData</code> as
77      * defined in <a HREF="http://www.ietf.org/rfc/rfc2440.txt">RFC 2440</a>,
78      * section 5.5.
79      *
80      * @return the PGP key material packet (may be <code>null</code> if not
81      * specified). Each invocation of this method returns a new clone to
82      * protect against subsequent modification.
83      */

84     byte[] getKeyPacket();
85
86     /**
87      * Returns an {@link Collections#unmodifiableList unmodifiable list}
88      * of {@link XMLStructure}s representing elements from an external
89      * namespace.
90      *
91      * @return an unmodifiable list of <code>XMLStructure</code>s (may be
92      * empty, but never <code>null</code>)
93      */

94     List JavaDoc getExternalElements();
95 }
96
Popular Tags