keyExport
This API exports key from the key manager.
Note
Key bytes are Hex encoded for AES and HMAC keys; PEM encoded for RSA keys.
URL
<http/https>://<host-name>:<Port>/protectappws/services/rest/keyExport
Input Parameters
Parameters | Description |
---|---|
username | User name (optional). |
password | Password associated with the user (optional). |
keyname | Name of the key to export. |
keyformat | Optional, format of the RSA or EC key to export. Valid values: PEM-PKCS#1 (default), PEM-PKCS#8, and PEM-SEC1. |
keytype | Optional, type of the RSA key to export. Valid values: Public or Private. |
certAlias | Client certificate alias for making SSL connections (optional). |
certPass | Password for the provided certificate alias (optional). |
Note
When exporting private EC keys, the key format must be set to PEM-SEC1 or PEM-PKCS#8.
Sample REST call for cxf
Symmetric Key
request
{
"Key_Export": {
"username": "cryptouser",
"password": "password123",
"keyname": "TestKey"
}
}
response
{
"KeyExportResponse": {
"keyExportResponse": "0B052C31FADE927B245E415C731EB5E9EF17665D72755515F7501C8C5104DE80"
}
}
Asymmetric Key
request
{
"Key_Export": {
"username": "NewUser",
"password": "abcd1234",
"keyname": "RSA_2048_Key_version#2",
"keyformat" : "PEM-PKCS#1",
"keytype" : "public"
}
}
response
{
"KeyExportResponse": {
"keyExportResponse":
"-----BEGIN RSA PUBLIC KEY-----\nMIIBCgKCAQEAnVHvexwnwh/Ryzg7jJN5V0M97Y+F6VQEHyX9CsiJemQaS8Xhs6ft\n3PyhEZ168WVDoqk6RZcTvX+4VkaemU/BkrRPUwR4FT5gWqVV6h+tP7zO3tcyCG3B
-----END RSA PUBLIC KEY-----"
}
}
Sample SOAP call
<prot:Key_Export>
<username>cryptouser</username>
<password>qwerty1234</password>
<keyname>aes256vt</keyname>
<keyformat>PEM-PKCS#8</keyformat>
<keytype>private</keytype>
</prot:Key_Export>
Output
<ns2:Key_ExportResponse xmlns:ns2="http://dsws.org/protectappws/">
-----BEGIN PRIVATE KEY-----
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJ0YqKNY1BEgctx2
je8QNie25JIHiODsmNqN3gwDRSehWhJB6neFawkslEhCLzTI+uJPcWquRirs2yo3
k9AkqnY1/7FvzcnsRgaPmcN2jolEs+DB8VWEQPMQP1IM/cF11grly5bgIXbHZww5
ZPI+EqyR2fk7UE3wS1GTA2E5ZSDZAgMBAAECgYAgJj+8zhz4NE/NVmXNmt+6WO+G
Awy8Gy9c6tOaWcD5T0gDnIHDXAZ/piPidcj7YHYXgnKPhoLNnhNsHFufqSFJJcLL
+dpm+oLW/6n43prltd8m4Yv5WytbhVzurv/j00hpptaE9qPNOpnqs42+mwMFH9gp
vB6TcbPLTue6nNsiAQJBAMySGeCMpMed8zzd0ojLoFxzn4MVYTzbZcCP8bSHg2+b
jOYLYhn30++f4gSmSrfucnYFfIZiQ1UdkjTJ9S1zr0kCQQDElytcIZjLmSiTsGb0
QWo6ihIMVnCXoF27VEpbsh9siEZHNfDgkKJWw3moZ+FOYBUZ0gOI3sekbnj/pUZl
KZURAkAKdCjYXbeJ79tfL+KzVNyD/PCYzT3j0z5W4cQzOn2P9X30v34q34w4AY6W
OD03OvskZtFfOKRCNDmlcvCRewjpAkAObbHm/yhBuSn7PPUxdCOhzERq12VIG6MF
frg+ZqJbytytmU3mjXb8uzgQnh8xK2ghDwLnZsJsVRdYW/8Aqb6hAkEAg9avKm7B
skk6IC178u3QD2XLSu/G8x0BJwmcr32qNdw7Wg4nK8NlPCLKeyNZ8CWNokTjYilr
nfdWKZiotldtYQ==
-----END PRIVATE KEY-----
</ns2:Key_ExportResponse>