xmlsec

How to add namespace while signing XML file using javax.xml.crypto.dsig.*?

天大地大妈咪最大 提交于 2020-01-12 21:48:12
问题 I'm trying to sign an xml file using enveloped signature and javax.xml.crypto.dsig.* classes. As a result I get file with correct Signature content but with no namespace defined. How can I add xmlns:ds="http://www.w3.org/2000/09/xmldsig#" namespace and corresponding ds prefixes? I don't see any place where I could define it. Example code: XMLSignatureFactory xmlSignatureFactory = XMLSignatureFactory.getInstance("DOM"); (...) XMLSignature signature = xmlSignatureFactory.newXMLSignature

Disable debug output in libxml2 and xmlsec

拈花ヽ惹草 提交于 2019-12-23 02:35:09
问题 In my software, I use libxml2 and xmlsec to manipulate (obviously) XML data structures. I mainly use XSD schema validation and so far, it works well. When the data structure input by the client doesn't match the XSD schema, libxml2 (or xmlsec) output some debug strings to the console. Here is an example: Entity: line 1: parser error : Start tag expected, '<' not found DUMMY<?xml ^ While those strings are useful for debugging purposes, I don't want them to appear and polute the console output

cxf + wss4j + maven NoSuchMethod error

若如初见. 提交于 2019-12-19 05:49:09
问题 trying to use the cxf+wss4j using maven. Created both the service and client without any compilation issues. The service runs fine in tomcat. Issue: When I run the client code, I get "java.lang.NoSuchMethodError: org.apache.xml.security.utils.I18n.init(Ljava/util/ResourceBundle;)V". This class is in xmlsec jar which comes along with cxf distribution. pom.xml for service project: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi

cxf + wss4j + maven NoSuchMethod error

最后都变了- 提交于 2019-12-19 05:48:08
问题 trying to use the cxf+wss4j using maven. Created both the service and client without any compilation issues. The service runs fine in tomcat. Issue: When I run the client code, I get "java.lang.NoSuchMethodError: org.apache.xml.security.utils.I18n.init(Ljava/util/ResourceBundle;)V". This class is in xmlsec jar which comes along with cxf distribution. pom.xml for service project: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi

XML - Why are relative namespaces considered to be invalid?

大兔子大兔子 提交于 2019-12-11 15:36:51
问题 I have a piece of XML that I am attempting to sign then verify which uses relative namespaces: <Organization> <OrganizationName xmlns:_xml="xml" _xml:lang="en">name</OrganizationName> <OrganizationDisplayName xmlns:_xml="xml" _xml:lang="en">name</OrganizationDisplayName> <OrganizationURL xmlns:_xml="xml" _xml:lang="en">http://www.example.com/</OrganizationURL> </Organization> OpenSAML throws the following exception: org.apache.xml.security.c14n.CanonicalizationException: Element

Verifying Windows 8 inapp-purchase receipt with xmlsec1

时光总嘲笑我的痴心妄想 提交于 2019-12-11 03:39:17
问题 How can I verify Win8 inapp-purchase receipt, using xmlsec1? Here is what I'm tyring to do: My sample receipt (saved in file receipt.xml ): <?xml version="1.0"?> <Receipt Version="1.0" ReceiptDate="2012-08-30T23:10:05Z" CertificateId="b809e47cd0110a4db043b3f73e83acd917fe1336" ReceiptDeviceId="4e362949-acc3-fe3a-e71b-89893eb4f528"> <AppReceipt Id="8ffa256d-eca8-712a-7cf8-cbf5522df24b" AppId="55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr" PurchaseDate="2012-06-04T23:07:24Z"

cxf + wss4j + maven NoSuchMethod error

送分小仙女□ 提交于 2019-12-01 03:30:34
trying to use the cxf+wss4j using maven. Created both the service and client without any compilation issues. The service runs fine in tomcat. Issue: When I run the client code, I get "java.lang.NoSuchMethodError: org.apache.xml.security.utils.I18n.init(Ljava/util/ResourceBundle;)V". This class is in xmlsec jar which comes along with cxf distribution. pom.xml for service project: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion