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