Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Java 1.4.6, Java 1.5.1
-
Security Level: Public (Public issues, viewable by everyone)
-
None
Description
An EncryptedKey can contain a ReferenceList that points to the EncryptedData.
WS-Security also extends XML Encryption to allow an independent ReferenceList.
The goal is to iterate over the ReferenceList to know which elements must be decrypted.
ReferenceList.getReferences() returns an Iterator<Reference> that can enumerate the references.
Unfortunately, there is no way to determine whether the Reference is a DataReference or a KeyReference.
Both DataReference and KeyReference classes are private so instanceof does not work.
The Reference interface does not contain a method to return the type a la org.w3c.dom.Node.getNodeType()
It is too ugly to compare the class name to DataReferenceImpl, so the only work-around is to reparse the ReferenceList by hand.