APIdia Launch Partner
Top Description Fields Constructors Methods
org.jcp.xml.dsig.internal.dom

public final Class DOMPGPData

extends DOMStructure
implements PGPData
Class Inheritance
All Implemented Interfaces
javax.xml.crypto.dsig.keyinfo.PGPData, javax.xml.crypto.XMLStructure
Imports
java.util.ArrayList, .Collections, .List, javax.xml.crypto.MarshalException, .XMLStructure, javax.xml.crypto.dom.DOMCryptoContext, javax.xml.crypto.dsig.XMLSignature, javax.xml.crypto.dsig.keyinfo.PGPData, com.sun.org.apache.xml.internal.security.utils.XMLUtils, org.w3c.dom.Document, .Element, .Node

DOM-based implementation of PGPData.

Field Summary

Modifier and TypeField and Description
private final List<XMLStructure>
private final byte[]
private final byte[]

Constructor Summary

AccessConstructor and Description
public
DOMPGPData(byte[]
a PGP Key Material Packet as defined in section 5.5 of RFC 2440. The array is cloned to prevent subsequent modification.
keyPacket
,
List<? extends XMLStructure>
a list of XMLStructures representing elements from an external namespace. The list is defensively copied to prevent subsequent modification. May be null or empty.
other
)

Creates a DOMPGPData containing the specified key packet.

public
DOMPGPData(byte[]
a PGP public key id as defined in section 11.2 of RFC 2440. The array is cloned to prevent subsequent modification.
keyId
,
byte[]
a PGP Key Material Packet as defined in section 5.5 of RFC 2440 (may be null). The array is cloned to prevent subsequent modification.
keyPacket
,
List<? extends XMLStructure>
a list of XMLStructures representing elements from an external namespace. The list is defensively copied to prevent subsequent modification. May be null or empty.
other
)

Creates a DOMPGPData containing the specified key id and optional key packet and list of external elements.

public
DOMPGPData(Element
a PGPData element
pdElem
)

Creates a DOMPGPData from an element.

Method Summary

Modifier and TypeMethod and Description
private void
checkKeyPacket(byte[] keyPacket)

We assume packets use the new format packet syntax, as specified in section 4 of RFC 2440.

public List<XMLStructure>
getExternalElements()

Implements javax.xml.crypto.dsig.keyinfo.PGPData.getExternalElements.

Returns an unmodifiable list of XMLStructures representing elements from an external namespace.

public byte[]
getKeyId()

Implements javax.xml.crypto.dsig.keyinfo.PGPData.getKeyId.

Returns the PGP public key identifier of this PGPData as defined in RFC 2440, section 11.2.

public byte[]
getKeyPacket()

Implements javax.xml.crypto.dsig.keyinfo.PGPData.getKeyPacket.

Returns the PGP key material packet of this PGPData as defined in RFC 2440, section 5.5.

public void
Inherited from org.jcp.xml.dsig.internal.dom.DOMStructure:
equalsContentisFeatureSupported

Field Detail

externalElementsback to summary
private final List<XMLStructure> externalElements
keyIdback to summary
private final byte[] keyId
keyPacketback to summary
private final byte[] keyPacket

Constructor Detail

DOMPGPDataback to summary
public DOMPGPData(byte[] keyPacket, List<? extends XMLStructure> other)

Creates a DOMPGPData containing the specified key packet. and optional list of external elements.

Parameters
keyPacket:byte[]

a PGP Key Material Packet as defined in section 5.5 of RFC 2440. The array is cloned to prevent subsequent modification.

other:List<? extends XMLStructure>

a list of XMLStructures representing elements from an external namespace. The list is defensively copied to prevent subsequent modification. May be null or empty.

Exceptions
NullPointerException:
if keyPacket is null
IllegalArgumentException:
if the key packet is not in the correct format
ClassCastException:
if other contains any entries that are not of type XMLStructure
DOMPGPDataback to summary
public DOMPGPData(byte[] keyId, byte[] keyPacket, List<? extends XMLStructure> other)

Creates a DOMPGPData containing the specified key id and optional key packet and list of external elements.

Parameters
keyId:byte[]

a PGP public key id as defined in section 11.2 of RFC 2440. The array is cloned to prevent subsequent modification.

keyPacket:byte[]

a PGP Key Material Packet as defined in section 5.5 of RFC 2440 (may be null). The array is cloned to prevent subsequent modification.

other:List<? extends XMLStructure>

a list of XMLStructures representing elements from an external namespace. The list is defensively copied to prevent subsequent modification. May be null or empty.

Exceptions
NullPointerException:
if keyId is null
IllegalArgumentException:
if the key id or packet is not in the correct format
ClassCastException:
if other contains any entries that are not of type XMLStructure
DOMPGPDataback to summary
public DOMPGPData(Element pdElem) throws MarshalException

Creates a DOMPGPData from an element.

Parameters
pdElem:Element

a PGPData element

Method Detail

checkKeyPacketback to summary
private void checkKeyPacket(byte[] keyPacket)

We assume packets use the new format packet syntax, as specified in section 4 of RFC 2440. This method only checks if the packet contains a valid tag. The contents of the packet should be checked by the application.

getExternalElementsback to summary
public List<XMLStructure> getExternalElements()

Implements javax.xml.crypto.dsig.keyinfo.PGPData.getExternalElements.

Doc from javax.xml.crypto.dsig.keyinfo.PGPData.getExternalElements.

Returns an unmodifiable list of XMLStructures representing elements from an external namespace.

Annotations
@Override
getKeyIdback to summary
public byte[] getKeyId()

Implements javax.xml.crypto.dsig.keyinfo.PGPData.getKeyId.

Doc from javax.xml.crypto.dsig.keyinfo.PGPData.getKeyId.

Returns the PGP public key identifier of this PGPData as defined in RFC 2440, section 11.2.

Annotations
@Override
getKeyPacketback to summary
public byte[] getKeyPacket()

Implements javax.xml.crypto.dsig.keyinfo.PGPData.getKeyPacket.

Doc from javax.xml.crypto.dsig.keyinfo.PGPData.getKeyPacket.

Returns the PGP key material packet of this PGPData as defined in RFC 2440, section 5.5.

Annotations
@Override
marshalback to summary
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context) throws MarshalException

Implements abstract org.jcp.xml.dsig.internal.dom.DOMStructure.marshal.

Annotations
@Override