Okay, I believe you called the /restman/1.0/privateKeys endpoint, not the /restman/1.0/privateKeys/{id}.
/restman/1.0/privateKeys only allow GET, when you create new private key, you should POST to /restman/1.0/privateKeys/{id}
{id} is in the form of [keystore ID]:[alias]
I done a test on gw9.3, the following is working to me,
method: POST
content-type: application/xml
authentication: basic authentication
URL: https://<gateway:port>/restman/1.0/privateKeys/00000000000000000000000000000002:srcAlias
body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:PrivateKeyCreationContext xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Dn>CN=srcAlias</l7:Dn>
</l7:PrivateKeyCreationContext>
note1: Your sample xml has some elements not recognized, it will cause "bad request" error
note2: 00000000000000000000000000000002 should be the default keystore ID, you can double confirm by sending a GET request to /restman/1.0/privateKeys
For more details and sample request, please refer to restman help,
https://<your gateway>:8443/restman/1.0/doc/restDoc.html#1.0/privateKeys