0N/A/*
2362N/A * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A/*
0N/A * $Id: PGPData.java,v 1.4 2005/05/10 16:35:35 mullan Exp $
0N/A */
0N/Apackage javax.xml.crypto.dsig.keyinfo;
0N/A
0N/Aimport java.util.Collections;
0N/Aimport java.util.List;
0N/Aimport javax.xml.crypto.XMLStructure;
0N/A
0N/A/**
0N/A * A representation of the XML <code>PGPData</code> element as defined in
0N/A * the <a href="http://www.w3.org/TR/xmldsig-core/">
0N/A * W3C Recommendation for XML-Signature Syntax and Processing</a>. A
0N/A * <code>PGPData</code> object is used to convey information related to
0N/A * PGP public key pairs and signatures on such keys. The XML Schema Definition
0N/A * is defined as:
0N/A *
0N/A * <pre>
0N/A * &lt;element name="PGPData" type="ds:PGPDataType"/&gt;
0N/A * &lt;complexType name="PGPDataType"&gt;
0N/A * &lt;choice&gt;
0N/A * &lt;sequence&gt;
0N/A * &lt;element name="PGPKeyID" type="base64Binary"/&gt;
0N/A * &lt;element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/&gt;
0N/A * &lt;any namespace="##other" processContents="lax" minOccurs="0"
0N/A * maxOccurs="unbounded"/&gt;
0N/A * &lt;/sequence&gt;
0N/A * &lt;sequence&gt;
0N/A * &lt;element name="PGPKeyPacket" type="base64Binary"/&gt;
0N/A * &lt;any namespace="##other" processContents="lax" minOccurs="0"
0N/A * maxOccurs="unbounded"/&gt;
0N/A * &lt;/sequence&gt;
0N/A * &lt;/choice&gt;
0N/A * &lt;/complexType&gt;
0N/A * </pre>
0N/A *
0N/A * A <code>PGPData</code> instance may be created by invoking one of the
0N/A * {@link KeyInfoFactory#newPGPData newPGPData} methods of the {@link
0N/A * KeyInfoFactory} class, and passing it
0N/A * <code>byte</code> arrays representing the contents of the PGP public key
0N/A * identifier and/or PGP key material packet, and an optional list of
0N/A * elements from an external namespace.
0N/A *
0N/A * @author Sean Mullan
0N/A * @author JSR 105 Expert Group
0N/A * @since 1.6
0N/A * @see KeyInfoFactory#newPGPData(byte[])
0N/A * @see KeyInfoFactory#newPGPData(byte[], byte[], List)
0N/A * @see KeyInfoFactory#newPGPData(byte[], List)
0N/A */
0N/Apublic interface PGPData extends XMLStructure {
0N/A
0N/A /**
0N/A * URI identifying the PGPData KeyInfo type:
0N/A * http://www.w3.org/2000/09/xmldsig#PGPData. This can be specified as the
0N/A * value of the <code>type</code> parameter of the {@link RetrievalMethod}
0N/A * class to describe a remote <code>PGPData</code> structure.
0N/A */
0N/A final static String TYPE = "http://www.w3.org/2000/09/xmldsig#PGPData";
0N/A
0N/A /**
0N/A * Returns the PGP public key identifier of this <code>PGPData</code> as
0N/A * defined in <a href="http://www.ietf.org/rfc/rfc2440.txt">RFC 2440</a>,
0N/A * section 11.2.
0N/A *
0N/A * @return the PGP public key identifier (may be <code>null</code> if
0N/A * not specified). Each invocation of this method returns a new clone
0N/A * to protect against subsequent modification.
0N/A */
0N/A byte[] getKeyId();
0N/A
0N/A /**
0N/A * Returns the PGP key material packet of this <code>PGPData</code> as
0N/A * defined in <a href="http://www.ietf.org/rfc/rfc2440.txt">RFC 2440</a>,
0N/A * section 5.5.
0N/A *
0N/A * @return the PGP key material packet (may be <code>null</code> if not
0N/A * specified). Each invocation of this method returns a new clone to
0N/A * protect against subsequent modification.
0N/A */
0N/A byte[] getKeyPacket();
0N/A
0N/A /**
0N/A * Returns an {@link Collections#unmodifiableList unmodifiable list}
0N/A * of {@link XMLStructure}s representing elements from an external
0N/A * namespace.
0N/A *
0N/A * @return an unmodifiable list of <code>XMLStructure</code>s (may be
0N/A * empty, but never <code>null</code>)
0N/A */
0N/A List getExternalElements();
0N/A}