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.
abc123qwe567lkj78...
The PFX file contains the following alias.
friendlyName: some-test.somedomain.com
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="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Pkcs12Data>abc123qwe567lkj78...</l7:Pkcs12Data>
<l7:Alias>some-test.somedomain.com</l7:Alias>
<l7:Password>itsa&secret!</l7:Password>
</l7:PrivateKeyImportContext>
And then I issue this command to perform the import.
GatewayMigrationUtility.sh restman -argFile example.properties -method POST -path '1.0/privateKeys/00000000000000000000000000000002:some-test.somedomain.com/import' -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 "
' to '
< to <
> to >
& to &
Need to be properly escaped as above so for example for a Private Key password that contains a & like,
<l7:Password>itsa&secret!</l7:Password>
It needs to be updated to be encoded like,
<l7:Password>itsa&secret!</l7:Password>