camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: CAMEL-8336: XML Signature: XAdES: Wrong value for attribute Qualifier of element CommitmentTypeId. Thanks to Franz for the patch.
Date Wed, 11 Feb 2015 17:46:21 GMT
Repository: camel
Updated Branches:
  refs/heads/master aaa6f5582 -> c38f9f331


CAMEL-8336: XML Signature: XAdES: Wrong value for attribute Qualifier of element CommitmentTypeId.
Thanks to Franz for the patch.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c38f9f33
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c38f9f33
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c38f9f33

Branch: refs/heads/master
Commit: c38f9f331bdb91d5e4b3072567e0075ceb65a751
Parents: aaa6f55
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Feb 11 18:46:46 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Feb 11 18:46:46 2015 +0100

----------------------------------------------------------------------
 .../xmlsecurity/api/XAdESSignatureProperties.java   |  4 ++--
 .../xmlsecurity/XAdESSignaturePropertiesTest.java   | 16 ++++++++--------
 2 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c38f9f33/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XAdESSignatureProperties.java
----------------------------------------------------------------------
diff --git a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XAdESSignatureProperties.java
b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XAdESSignatureProperties.java
index 3daddf9..c6cb160 100644
--- a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XAdESSignatureProperties.java
+++ b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XAdESSignatureProperties.java
@@ -694,8 +694,8 @@ public class XAdESSignatureProperties implements XmlSignatureProperties
{
         Element identifier = createElement("Identifier", doc, input);
         commitmentTypeIdEl.appendChild(identifier);
         identifier.setTextContent(getCommitmentTypeId());
-        if (getDataObjectFormatIdentifierQualifier() != null && !getDataObjectFormatIdentifierQualifier().isEmpty())
{
-            setAttribute(identifier, "Qualifier", getDataObjectFormatIdentifierQualifier());
+        if (getCommitmentTypeIdQualifier() != null && !getCommitmentTypeIdQualifier().isEmpty())
{
+            setAttribute(identifier, "Qualifier", getCommitmentTypeIdQualifier());
         }
         if (getCommitmentTypeIdDescription() != null && !getCommitmentTypeIdDescription().isEmpty())
{
             Element description = createElement("Description", doc, input);

http://git-wip-us.apache.org/repos/asf/camel/blob/c38f9f33/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XAdESSignaturePropertiesTest.java
----------------------------------------------------------------------
diff --git a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XAdESSignaturePropertiesTest.java
b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XAdESSignaturePropertiesTest.java
index 5af5cfc..ef7401b 100644
--- a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XAdESSignaturePropertiesTest.java
+++ b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XAdESSignaturePropertiesTest.java
@@ -152,7 +152,7 @@ public class XAdESSignaturePropertiesTest extends CamelTestSupport {
         // signature policy
         checkXpath(doc, pathToSignatureProperties
                 + "etsi:SignaturePolicyIdentifier/etsi:SignaturePolicyId/etsi:SigPolicyId/etsi:Identifier/text()",
prefix2Namespace,
-                "urn:oid:1.2.840.113549.1.9.16.6.1");
+                "1.2.840.113549.1.9.16.6.1");
         checkXpath(doc, pathToSignatureProperties
                 + "etsi:SignaturePolicyIdentifier/etsi:SignaturePolicyId/etsi:SigPolicyId/etsi:Identifier/@Qualifier",
prefix2Namespace,
                 "OIDAsURN");
@@ -213,7 +213,7 @@ public class XAdESSignaturePropertiesTest extends CamelTestSupport {
         checkXpath(doc, pathToDataObjectProperties + "etsi:DataObjectFormat/etsi:Description/text()",
prefix2Namespace, "invoice");
         checkXpath(doc, pathToDataObjectProperties + "etsi:DataObjectFormat/etsi:MimeType/text()",
prefix2Namespace, "text/xml");
         checkXpath(doc, pathToDataObjectProperties + "etsi:DataObjectFormat/etsi:ObjectIdentifier/etsi:Identifier/text()",
-                prefix2Namespace, "urn:oid:1.2.840.113549.1.9.16.6.2");
+                prefix2Namespace, "1.2.840.113549.1.9.16.6.2");
         checkXpath(doc, pathToDataObjectProperties + "etsi:DataObjectFormat/etsi:ObjectIdentifier/etsi:Identifier/@Qualifier",
                 prefix2Namespace, "OIDAsURN");
         checkXpath(doc, pathToDataObjectProperties + "etsi:DataObjectFormat/etsi:ObjectIdentifier/etsi:Description/text()",
@@ -227,9 +227,9 @@ public class XAdESSignaturePropertiesTest extends CamelTestSupport {
 
         //commitment 
         checkXpath(doc, pathToDataObjectProperties + "etsi:CommitmentTypeIndication/etsi:CommitmentTypeId/etsi:Identifier/text()",
-                prefix2Namespace, "urn:oid:1.2.840.113549.1.9.16.6.4");
+                prefix2Namespace, "1.2.840.113549.1.9.16.6.4");
         checkXpath(doc, pathToDataObjectProperties + "etsi:CommitmentTypeIndication/etsi:CommitmentTypeId/etsi:Identifier/@Qualifier",
-                prefix2Namespace, "OIDAsURN");
+                prefix2Namespace, "OIDAsURI");
         checkXpath(doc, pathToDataObjectProperties + "etsi:CommitmentTypeIndication/etsi:CommitmentTypeId/etsi:Description/text()",
                 prefix2Namespace, "description for commitment type ID");
         checkXpath(doc, pathToDataObjectProperties
@@ -763,7 +763,7 @@ public class XAdESSignaturePropertiesTest extends CamelTestSupport {
 
         // policy
         props.setSignaturePolicy(XAdESSignatureProperties.SIG_POLICY_EXPLICIT_ID);
-        props.setSigPolicyId("urn:oid:1.2.840.113549.1.9.16.6.1");
+        props.setSigPolicyId("1.2.840.113549.1.9.16.6.1");
         props.setSigPolicyIdQualifier("OIDAsURN");
         props.setSigPolicyIdDescription("invoice version 3.1");
         props.setSignaturePolicyDigestAlgorithm(DigestMethod.SHA256);
@@ -789,15 +789,15 @@ public class XAdESSignaturePropertiesTest extends CamelTestSupport {
         // data object format
         props.setDataObjectFormatDescription("invoice");
         props.setDataObjectFormatMimeType("text/xml");
-        props.setDataObjectFormatIdentifier("urn:oid:1.2.840.113549.1.9.16.6.2");
+        props.setDataObjectFormatIdentifier("1.2.840.113549.1.9.16.6.2");
         props.setDataObjectFormatIdentifierQualifier("OIDAsURN");
         props.setDataObjectFormatIdentifierDescription("identifier desc");
         props.setDataObjectFormatIdentifierDocumentationReferences(Arrays.asList(new String[]
{
             "http://test.com/dataobject.format.doc.ref1.txt", "http://test.com/dataobject.format.doc.ref2.txt"
}));
 
         //commitment
-        props.setCommitmentTypeId("urn:oid:1.2.840.113549.1.9.16.6.4");
-        props.setCommitmentTypeIdQualifier("OIDAsURN");
+        props.setCommitmentTypeId("1.2.840.113549.1.9.16.6.4");
+        props.setCommitmentTypeIdQualifier("OIDAsURI");
         props.setCommitmentTypeIdDescription("description for commitment type ID");
         props.setCommitmentTypeIdDocumentationReferences(Arrays.asList(new String[] {"http://test.com/commitment.ref1.txt",
             "http://test.com/commitment.ref2.txt" }));


Mime
View raw message