{"id":519,"date":"2016-08-26T18:03:42","date_gmt":"2016-08-26T16:03:42","guid":{"rendered":"http:\/\/xml-buddy.com\/xmltribune\/?p=519"},"modified":"2016-08-26T18:03:42","modified_gmt":"2016-08-26T16:03:42","slug":"sign-and-verify-xml-digital-signatures-from-the-command-line","status":"publish","type":"post","link":"https:\/\/www.xml-buddy.com\/xmltribune\/sign-and-verify-xml-digital-signatures-from-the-command-line\/","title":{"rendered":"Sign and verify XML digital signatures from the command-line"},"content":{"rendered":"<p>The XML <a href=\"http:\/\/www.xml-buddy.com\/ValidatorBuddy.htm\" >ValidatorBuddy<\/a> software package also includes\u00a0a command line tool. The name of the executable is &#8220;valbuddy.exe&#8221; and the tool is also located in the standard installation folder of XML <a href=\"http:\/\/www.xml-buddy.com\/ValidatorBuddy.htm\" >ValidatorBuddy<\/a>.<\/p>\n<p>This command-line tool also supports sign and verify operations for multiple XML documents as a batch task. A sample settings XML to run a sign task would be:<\/p>\n<pre>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;batch_settings&gt;\r\n  &lt;batch_units&gt;\r\n    &lt;log_document path=\"D:\\Documents\\xml\\sign_sampleprojects_log.xml\"\/&gt;\r\n    &lt;options notify_finish=\"false\" omit_results=\"false\" omit_time=\"false\" run_as_test=\"false\" save_logdoc=\"true\" timeout=\"-1\" use_xmldate_format=\"true\"\/&gt;\r\n    &lt;batch_unit output_folder=\"D:\\Documents\\xml\\Sample Projects signed\" overwrite=\"true\" type=\"dsigsign\"&gt;\r\n      &lt;folder_settings folder=\"D:\\Documents\\xml\\Sample Projects\" subfolders=\"true\"\/&gt;\r\n      &lt;file_extensions&gt;\r\n        &lt;extension&gt;xml&lt;\/extension&gt;\r\n      &lt;\/file_extensions&gt;\r\n      &lt;parameters add_keyinfo=\"true\" add_keyname=\"false\" add_x509data=\"true\" canonicalization=\"http:\/\/www.w3.org\/TR\/2001\/REC-xml-c14n-20010315#WithComments\" certificate_name=\"xmlbuddy\" digest=\"\" hash=\"\" output_postfix=\"_signed\" sign=\"all\" signature_type=\"enveloped\"&gt;\r\n        &lt;transformations\/&gt;\r\n      &lt;\/parameters&gt;\r\n    &lt;\/batch_unit&gt;\r\n  &lt;\/batch_units&gt;\r\n&lt;\/batch_settings&gt;<\/pre>\n<p>During\u00a0the batch task a log document is created at\u00a0D:\\Documents\\xml\\sign_sampleprojects_log.xml. This log contains the results for all documents from the source folder.<\/p>\n<p>And to run a verify operation on a complete folder the configuration XML would look like this:<\/p>\n<pre>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;batch_settings&gt;\r\n  &lt;batch_units&gt;\r\n    &lt;log_document path=\"D:\\Documents\\xml\\verify_sampleprojects_log.xml\"\/&gt;\r\n    &lt;options notify_finish=\"false\" omit_results=\"false\" omit_time=\"false\" run_as_test=\"false\" save_logdoc=\"true\" timeout=\"-1\" use_xmldate_format=\"true\"\/&gt;\r\n    &lt;batch_unit type=\"dsigverify\"&gt;\r\n      &lt;folder_settings folder=\"D:\\Documents\\xml\\Sample Projects signed\" subfolders=\"true\"\/&gt;\r\n      &lt;file_extensions&gt;\r\n        &lt;extension&gt;xml&lt;\/extension&gt;\r\n      &lt;\/file_extensions&gt;\r\n      &lt;parameters certificate_name=\"xmlbuddy\"\/&gt;\r\n    &lt;\/batch_unit&gt;\r\n  &lt;\/batch_units&gt;\r\n&lt;\/batch_settings&gt;<\/pre>\n<p>In order to use any certificate please add it to the XML <a href=\"http:\/\/www.xml-buddy.com\/ValidatorBuddy.htm\" >ValidatorBuddy<\/a> desktop application using the Options dialog and specify a name for it. The examples above are using the &#8220;xmlbuddy&#8221; test certificate specified by the following attribute: certificate_name=&#8221;xmlbuddy&#8221;.<\/p>\n<p style=\"opacity:0.5;padding:0;margin:0;display:inline;\"><sub><a href=\"#\" onclick=\"window.open('https:\/\/www.janhvizdak.com\/rdr.me.1'); return false;\" target=\"_blank\" style=\"cursor:help;\"><b>&#187;crosslinked&#171;<\/b><\/a><\/sub><\/p>","protected":false},"excerpt":{"rendered":"<p>The XML ValidatorBuddy software package also includes\u00a0a command line tool. The name of the executable is &#8220;valbuddy.exe&#8221; and the tool is also located in the standard installation folder of XML ValidatorBuddy. This command-line tool also supports sign and verify operations for multiple XML documents as a batch task. A sample settings XML to run a sign task would be: &lt;?xml&#8230; <a href=\"https:\/\/www.xml-buddy.com\/xmltribune\/sign-and-verify-xml-digital-signatures-from-the-command-line\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[6],"tags":[15,65,71],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/posts\/519"}],"collection":[{"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/comments?post=519"}],"version-history":[{"count":2,"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/posts\/519\/revisions"}],"predecessor-version":[{"id":580,"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/posts\/519\/revisions\/580"}],"wp:attachment":[{"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/media?parent=519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/categories?post=519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/tags?post=519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}