Forum Discussion
martijnbrands_3
Nimbostratus
Feb 22, 2019Rest API generate key with passphrase
How can I generate a key with passphrase through the REST API. I do the following :
POST mgmt/tm/sys/crypto/key
{
"name": "/Common/test.domain.nl123.key",
"keyType": "rsa-pri...
Feb 26, 2019
I think you got the syntax wrong for the command:
This worked fine for me:
curl -sku admin:admin https://192.168.10.23/mgmt/tm/util/bash -H "content-type:application/json" -d "
{
\"command\": \"run\",
\"utilCmdArgs\": \"-c 'openssl genrsa -aes256 -passout pass:DitIsEenTest123 -out /config/ssl/ssl.key/f5test.com_2015.key 2048'\"
}
"
Result:
{"kind":"tm:util:bash:runstate","command":"run","utilCmdArgs":"-c 'openssl genrsa -aes256 -passout pass:DitIsEenTest123 -out /config/ssl/ssl.key/f5test.com_2015.key 2048'","commandResult":"Generating RSA private key, 2048 bit long modulus\n.......................+++++\n..................+++++\nunable to write 'random state'\ne is 65537 (0x10001)\n"}`
And file exists:
[root@f5yp01:Active:Disconnected] config ls /config/ssl/ssl.key/
default.key f5test.com_2015.key
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects