You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Clement Pellerin (Updated) (JIRA)" <ji...@apache.org> on 2012/03/20 16:57:38 UTC

[jira] [Updated] (SANTUARIO-304) No way to distinguish DataReference from a KeyReference when iterating a ReferenceList

     [ https://issues.apache.org/jira/browse/SANTUARIO-304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Pellerin updated SANTUARIO-304:
---------------------------------------

    Attachment: santuario-304.zip

I am attaching a patch.

The ReferenceList already has integer values DATA_REFERENCE and KEY_REFERENCE but they are in the wrong class and frankly, I would prefer they go away. Their use is to restrict the ReferenceList to hold a single kind of Reference. This seems to be a limitation of Santuario compared to the XML Encryption spec. I will log a bug about this eventually.

I did something similar to C# and I returned the element tag name as a String instead.

I have updated your RefListMartialTest and renamed it ReferenceListTest.

I was able to run the tests after I removed my older junit.jar in the lib directory of ant.
                
> No way to distinguish DataReference from a KeyReference when iterating a ReferenceList
> --------------------------------------------------------------------------------------
>
>                 Key: SANTUARIO-304
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-304
>             Project: Santuario
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: Java 1.4.6, Java 1.5.1
>            Reporter: Clement Pellerin
>            Assignee: Colm O hEigeartaigh
>         Attachments: santuario-304.zip
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira