You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org> on 2014/07/21 12:05:39 UTC

[jira] [Commented] (SANTUARIO-395) decryption with apache santuario for xml

    [ https://issues.apache.org/jira/browse/SANTUARIO-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14068371#comment-14068371 ] 

Colm O hEigeartaigh commented on SANTUARIO-395:
-----------------------------------------------

Hi,

JIRA is not an appropriate place to ask questions, please direct all future queries to the Apache Santuario mailing lists:

http://santuario.apache.org/mailing.html

In the streaming encryption/decryption sample you reference, the payload is simply the decrypted stream. It's up to you to decide how you want to handle it. For example, see the following tests:

http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/DecryptionTest.java?revision=1589370&view=co

This uses some test code to convert the (decrypted) stream into a DOM Document Object:

 XMLStreamReader securityStreamReader = 
                inboundXMLSec.processInMessage(xmlStreamReader, null, securityEventListener);
         
        document = StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);

Colm.

> decryption with apache santuario for xml
> ----------------------------------------
>
>                 Key: SANTUARIO-395
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-395
>             Project: Santuario
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: Java 2.0.1
>            Reporter: Mujahed Syed
>            Assignee: Colm O hEigeartaigh
>
> Hi am referring to project santuario (http://santuario.apache.org/javaindex.html) There are really good sample test cases to download from github (https://github.com/coheigea/testcases.git).
> so as per the requirement I am trying to encrypt and decrypt an xml document, I am able to achieve encryption by using the framework but I am unable to figure out how i can decrypt it, that's because I register the required listeners for StAX api and they dont seem to be getting called, the decryption code that is demonstrated in the method "decryptUsingStAX" of utility (https://github.com/coheigea/testcases/blob/master/apache/santuario/santuario-xml-encryption/src/test/java/org/apache/coheigea/santuario/xmlencryption/EncryptionUtils.java) class is decrypting only qname or the name of the node that was decrypted but i cannot see a way to get the payload that was present.
> I tried following:
>  List<ContentEncryptedElementSecurityEvent> encryptedElementContents =
>  eventListener.getSecurityEvents(SecurityEventConstants.ContentEncrypted);
> and encryptedElementContents.size() returns zero.
> decryptUsingStAX method provided by the author looks like only checking and decrypting the element name, but can someone throw some light how to get the payload or some documentation on how to decrypt.
> Thanks.



--
This message was sent by Atlassian JIRA
(v6.2#6252)