<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CSR export via XML API in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/csr-export-via-xml-api/m-p/514550#M3120</link>
    <description>&lt;P&gt;Yes, it is the same API command to export a CSR as it is for a certificate, and the API command you posted&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/215059"&gt;@FabioSouza&lt;/a&gt;&amp;nbsp;looks correct. Maybe there was something very subtle going on like the example above from&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/51945"&gt;@Nikolay-Matveev&lt;/a&gt;, so I recommend a TAC case to investigate further.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Sep 2022 10:44:53 GMT</pubDate>
    <dc:creator>JimmyHolland</dc:creator>
    <dc:date>2022-09-12T10:44:53Z</dc:date>
    <item>
      <title>CSR export via XML API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/csr-export-via-xml-api/m-p/353487#M2463</link>
      <description>&lt;P&gt;&lt;FONT face="georgia,palatino"&gt;I am trying to export a CSR via XML API as per &lt;A href="https://docs.paloaltonetworks.com/pan-os/9-0/pan-os-panorama-api/pan-os-xml-api-request-types/export-files-api/export-certificates-and-keys.html" target="_blank" rel="noopener"&gt;this article&lt;/A&gt;&amp;nbsp;and as per &lt;FONT face="courier new,courier"&gt;/debug&lt;/FONT&gt; output that I get when I perform the export via Web UI.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="georgia,palatino"&gt;The request I run is as follows:&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;https://&amp;lt;fw-address&amp;gt;/api/?type=export&amp;amp;category=certificate&amp;amp;certificate-name=&amp;lt;cert-name&amp;gt;&amp;amp;format=pkcs10&amp;amp;include-key=no&amp;amp;key=&amp;lt;api_key&amp;gt;&lt;/LI-CODE&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;FONT face="georgia,palatino"&gt;However this does not quite work - I get an error message that says:&lt;/FONT&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;Failed to prepare CSR &amp;lt;cert-name&amp;gt; for export. PKCS10 format can only be used with CSRs and not certificates.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;FONT face="georgia,palatino"&gt;I have now run out of ideas what it does not like in the request. The article explicitely says - "&lt;EM&gt;You can use the example above to export a certificate signing request (CSR). If you do so, then specify the following two parameters as shown:&amp;nbsp;&lt;SPAN&gt;format -&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;pkcs10,&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;include-key - no&lt;/EM&gt;" and this is exactly what I am doing. The debug out for a succefull operation suggests the same syntax:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;request cmd="op" cookie="1001040547321532"&amp;gt;
  &amp;lt;operations xml="yes"&amp;gt;
    &amp;lt;download&amp;gt;
      &amp;lt;certificate&amp;gt;
        &amp;lt;certificate-name&amp;gt;cert-name&amp;lt;/certificate-name&amp;gt;
        &amp;lt;format&amp;gt;pkcs10&amp;lt;/format&amp;gt;
        &amp;lt;include-####censored 'key''####
[2020/10/01 23:06:58] user=1001040547321532
Response took 0.040s &amp;lt;response status="success"&amp;gt;&amp;lt;result&amp;gt;&amp;lt;content encoding="base64"&amp;gt;&lt;BR /&gt;&amp;lt;---encoded csr goes here--&amp;gt;
]]&amp;gt;&amp;lt;/content&amp;gt;&amp;lt;/result&amp;gt;&amp;lt;/response&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT face="georgia,palatino"&gt;Has anybody has an idea about the correct format of the request?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 22:51:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/csr-export-via-xml-api/m-p/353487#M2463</guid>
      <dc:creator>Nikolay-Matveev</dc:creator>
      <dc:date>2020-10-01T22:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: CSR export via XML API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/csr-export-via-xml-api/m-p/353566#M2464</link>
      <description>&lt;P&gt;Spoke to TAC (the engineer said he had been unable to reproduce), reproduced the issue for him, then we removed spaces from cert name and subject - the issue was gone, re-added the spaces - the issue did NOT re-occur. There must have been something else, very subtle, that trigerred the error. We'll keep playing with this and update this thread if manage to discover anything...&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 09:05:27 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/csr-export-via-xml-api/m-p/353566#M2464</guid>
      <dc:creator>Nikolay-Matveev</dc:creator>
      <dc:date>2020-10-02T09:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: CSR export via XML API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/csr-export-via-xml-api/m-p/484156#M3017</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the same error message trying to export the CSR for an existing certificate. My guess is that only works for CSR objects and not for certificates. Works fine for me to export just the CSR without a certificate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- Create the CSR&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;https://&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{{PaloaltoIP}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/api?key=&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{{key}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;type=op&amp;amp;cmd=&amp;lt;request&amp;gt;&amp;lt;certificate&amp;gt;&amp;lt;generate&amp;gt;&amp;lt;certificate-name&amp;gt;test-server-1&amp;lt;/certificate-name&amp;gt;&amp;lt;name&amp;gt;test-server-1&amp;lt;/name&amp;gt;&amp;lt;algorithm&amp;gt;&amp;lt;RSA&amp;gt;&amp;lt;rsa-nbits&amp;gt;2048&amp;lt;/rsa-nbits&amp;gt;&amp;lt;/RSA&amp;gt;&amp;lt;/algorithm&amp;gt;&amp;lt;digest&amp;gt;sha256&amp;lt;/digest&amp;gt;&amp;lt;ca&amp;gt;no&amp;lt;/ca&amp;gt;&amp;lt;signed-by&amp;gt;external&amp;lt;/signed-by&amp;gt;&amp;lt;/generate&amp;gt;&amp;lt;/certificate&amp;gt;&amp;lt;/request&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- Export the CSR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;https://&lt;SPAN class=""&gt;{{PaloaltoIP}}&lt;/SPAN&gt;/api?key=&lt;SPAN class=""&gt;{{key}}&lt;/SPAN&gt;&amp;amp;type=export&amp;amp;category=certificate&amp;amp;certificate-name=test-server-1&amp;amp;include-key=no&amp;amp;format=pkcs10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Should it work for a certificate as well?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;cheers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 13:58:41 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/csr-export-via-xml-api/m-p/484156#M3017</guid>
      <dc:creator>FabioSouza</dc:creator>
      <dc:date>2022-05-02T13:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: CSR export via XML API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/csr-export-via-xml-api/m-p/514550#M3120</link>
      <description>&lt;P&gt;Yes, it is the same API command to export a CSR as it is for a certificate, and the API command you posted&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/215059"&gt;@FabioSouza&lt;/a&gt;&amp;nbsp;looks correct. Maybe there was something very subtle going on like the example above from&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/51945"&gt;@Nikolay-Matveev&lt;/a&gt;, so I recommend a TAC case to investigate further.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 10:44:53 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/csr-export-via-xml-api/m-p/514550#M3120</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-09-12T10:44:53Z</dc:date>
    </item>
  </channel>
</rss>

