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
DOM-based implementation of PGPData.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<XMLStructure> private final byte[]private final byte[] -
Constructor Summary
ConstructorsConstructorDescriptionDOMPGPData(byte[] keyId, byte[] keyPacket, List<? extends XMLStructure> other) Creates aDOMPGPDatacontaining the specified key id and optional key packet and list of external elements.DOMPGPData(byte[] keyPacket, List<? extends XMLStructure> other) Creates aDOMPGPDatacontaining the specified key packet.DOMPGPData(Element pdElem) Creates aDOMPGPDatafrom an element. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckKeyPacket(byte[] keyPacket) We assume packets use the new format packet syntax, as specified in section 4 of RFC 2440.byte[]getKeyId()byte[]voidmarshal(Node parent, String dsPrefix, DOMCryptoContext context) Methods inherited from class DOMStructure
isFeatureSupportedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface XMLStructure
isFeatureSupported
-
Field Details
-
keyId
private final byte[] keyId -
keyPacket
private final byte[] keyPacket -
externalElements
-
-
Constructor Details
-
DOMPGPData
Creates aDOMPGPDatacontaining 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 ofXMLStructures representing elements from an external namespace. The list is defensively copied to prevent subsequent modification. May benullor empty.- Throws:
NullPointerException- ifkeyPacketisnullIllegalArgumentException- if the key packet is not in the correct formatClassCastException- ifothercontains any entries that are not of typeXMLStructure
-
DOMPGPData
Creates aDOMPGPDatacontaining 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 ofXMLStructures representing elements from an external namespace. The list is defensively copied to prevent subsequent modification. May benullor empty.- Throws:
NullPointerException- ifkeyIdisnullIllegalArgumentException- if the key id or packet is not in the correct formatClassCastException- ifothercontains any entries that are not of typeXMLStructure
-
DOMPGPData
Creates aDOMPGPDatafrom an element.- Parameters:
pdElem- a PGPData element- Throws:
MarshalException
-
-
Method Details
-
getKeyId
-
getKeyPacket
public byte[] getKeyPacket()- Specified by:
getKeyPacketin interfacePGPData
-
getExternalElements
- Specified by:
getExternalElementsin interfacePGPData
-
marshal
- Specified by:
marshalin classDOMStructure- Throws:
MarshalException
-
checkKeyPacket
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.
-