search cancel

"The request sent by the client was syntactically incorrect" when attempting Private Key import using


Article ID: 226140


Updated On:


CA API Gateway


We have a PFX file that contains a root certificate, an intermediate certificate, and a server certificate. On my Linux system, I use the base64 command to generate the payload of our PFX file.

base64 | example.pfx

Which returns a base 64 string, something like this.


The PFX file contains the following alias.


Let's say the password for the PFX file is itsa&secret!

I create example.xml that will be used for the import. My XML file looks like this.

<l7:PrivateKeyImportContext xmlns:l7="">





And then I issue this command to perform the import. restman -argFile -method POST -path '1.0/privateKeys/' -request example.xml

The following is being returned.

Status: 400 Bad Request

<h3>The request sent by the client was syntactically incorrect.</h3>



Release :

Component :


When using XML (like a restman xml) any value with special reserved XML chars which are,

" to  &quot;
' to  &apos;
< to  &lt;
> to  &gt;
& to  &amp;

Need to be properly escaped as above so for example for a Private Key password that contains a & like,


It needs to be updated to be encoded like,