Class DOMPGPData
- java.lang.Object
-
- org.apache.jcp.xml.dsig.internal.dom.DOMStructure
-
- org.apache.jcp.xml.dsig.internal.dom.DOMPGPData
-
- All Implemented Interfaces:
PGPData
,XMLStructure
public final class DOMPGPData extends DOMStructure implements PGPData
DOM-based implementation of PGPData.
-
-
Constructor Summary
Constructors Constructor Description DOMPGPData(byte[] keyId, byte[] keyPacket, List<? extends XMLStructure> other)
Creates aDOMPGPData
containing the specified key id and optional key packet and list of external elements.DOMPGPData(byte[] keyPacket, List<? extends XMLStructure> other)
Creates aDOMPGPData
containing the specified key packet.DOMPGPData(Element pdElem)
Creates aDOMPGPData
from an element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<XMLStructure>
getExternalElements()
byte[]
getKeyId()
byte[]
getKeyPacket()
void
marshal(Node parent, String dsPrefix, DOMCryptoContext context)
-
Methods inherited from class org.apache.jcp.xml.dsig.internal.dom.DOMStructure
isFeatureSupported
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.xml.crypto.XMLStructure
isFeatureSupported
-
-
-
-
Constructor Detail
-
DOMPGPData
public DOMPGPData(byte[] keyPacket, List<? extends XMLStructure> other)
Creates aDOMPGPData
containing the specified key packet. and optional list of external elements.- Parameters:
keyPacket
- a PGP Key Material Packet as defined in section 5.5 of RFC 2440. The array is cloned to prevent subsequent modification.other
- a list ofXMLStructure
s representing elements from an external namespace. The list is defensively copied to prevent subsequent modification. May benull
or empty.- Throws:
NullPointerException
- ifkeyPacket
isnull
IllegalArgumentException
- if the key packet is not in the correct formatClassCastException
- ifother
contains any entries that are not of typeXMLStructure
-
DOMPGPData
public DOMPGPData(byte[] keyId, byte[] keyPacket, List<? extends XMLStructure> other)
Creates aDOMPGPData
containing the specified key id and optional key packet and list of external elements.- Parameters:
keyId
- a PGP public key id as defined in section 11.2 of RFC 2440. The array is cloned to prevent subsequent modification.keyPacket
- a PGP Key Material Packet as defined in section 5.5 of RFC 2440 (may benull
). The array is cloned to prevent subsequent modification.other
- a list ofXMLStructure
s representing elements from an external namespace. The list is defensively copied to prevent subsequent modification. May benull
or empty.- Throws:
NullPointerException
- ifkeyId
isnull
IllegalArgumentException
- if the key id or packet is not in the correct formatClassCastException
- ifother
contains any entries that are not of typeXMLStructure
-
DOMPGPData
public DOMPGPData(Element pdElem) throws MarshalException
Creates aDOMPGPData
from an element.- Parameters:
pdElem
- a PGPData element- Throws:
MarshalException
-
-
Method Detail
-
getKeyPacket
public byte[] getKeyPacket()
- Specified by:
getKeyPacket
in interfacePGPData
-
getExternalElements
public List<XMLStructure> getExternalElements()
- Specified by:
getExternalElements
in interfacePGPData
-
marshal
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context) throws MarshalException
- Specified by:
marshal
in classDOMStructure
- Throws:
MarshalException
-
-