santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm O hEigeartaigh <cohei...@apache.org>
Subject Re: how to add EncryptionProperty with custom value into encrypted xml ?
Date Wed, 15 Oct 2014 09:22:28 GMT
Hi Martin,

It appears that this feature was not supported until now. I've added a JIRA
(+ fix):

https://issues.apache.org/jira/browse/SANTUARIO-403
http://svn.apache.org/viewvc?view=revision&revision=r1631978

Colm.

On Tue, Oct 14, 2014 at 10:52 AM, Martin Vich <vichmartin@gmail.com> wrote:

> Hi,
>
> it seems that adding EncryptionProperty value into xml is little bit
> tricky. I am working with 2.0.2 xmlsec (Java implementation). Take a look
> on Encrypter class in samples
> (org.apache.xml.security.samples.encryption.Enrypter).
>
> In main method I tried to add encryptionProperty into encryptedData
> variable like this :
>
> Element elem = XMLUtils.createElementInEncryptionSpace(
>                     doc, EncryptionConstants._TAG_ENCRYPTIONPROPERTIES
>                 );
>         elem.setTextContent("here should be sha1 hash of encryption key");
>
> EncryptionProperties eps = xmlCipher.createEncryptionProperties();
> EncryptionProperty ep = xmlCipher.createEncryptionProperty();
>                    ep.addEncryptionInformation(elem);
>                    eps.addEncryptionProperty(ep);
>
>         EncryptedData encData = xmlCipher.getEncryptedData();
>                       encData.setEncryptionProperties(eps);
>
> ...all i get as a output is empty EncryptionProperty tag without any value
> inside. Is my inicialization of element and usage of xmlsec API correct ?
>
> Regards,
> Martin
>
>
>


-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Mime
View raw message