KeyGen
This API generates keys.
URL
<http/https>://<host-name>:<Port>/protectappws/services/rest/keyGen
Input Parameters
Parameters | Description |
---|---|
username | User name (optional). |
password | Password associated with the user (optional). |
keyname | Name of the new key to be generated/deleted. |
keyalgorithm | Algorithm to be used for key generation. Possible options are: —RSA-2048 —RSA-3072 —RSA-4096 — AES-128 — AES-192 — AES-256 — HmacSHA1 — HmacSHA256 — HmacSHA384 — HmacSHA512 — EC-secp224k1-224 — EC-secp224r1-224 — EC-secp256k1-256 — EC-secp384r1-384 — EC-secp521r1-521 — EC-prime256v1-256 — EC-brainpoolP224r1-224 — EC-brainpoolP224t1-224 — EC-brainpoolP256r1-256 — EC-brainpoolP256t1-256 — EC-brainpoolP384r1-384 — EC-brainpoolP384t1-384 — EC-brainpoolP512r1-512 — EC-brainpoolP512t1-512 Algorithm to be used for deleting the key - Del. |
keyisdeletable | Set if the key will be deletable via the API – boolean, default is false. |
keyisexportable | Set if the new key will be exportable via the API – boolean, default is false. |
keyisversioned | Set if the new key will be a versioned key – boolean, default is false. |
keytemplate | Identify a template to use as a basis for the key generation (optional). |
keyistemplate | Set if generating a template rather than a key – boolean, default is false (optional). |
certAlias | Client certificate alias for making SSL connections (optional). |
certPass | Password for the provided certificate alias (optional). |
Sample REST call for cxf
For generating a key
request
{
"Key_Gen": {
"username": "cryptouser",
"password": "safenet123",
"keyname": "TestKey",
"keyalgorithm": "AES-256",
"keyisdeletable": "false",
"keyisexportable": "false",
"keyisversioned": "false",
"keyistemplate": "true"
}
}
response
{
"KeyGenResponse": {
"keyGenResponse": "true"
}
}
For deleting a key
request
{
"Key_Gen": {
"username": "admin",
"password": "Asdf@1234",
"keyname": "TestKey1",
"keyalgorithm": "Del",
"keyisdeletable": "true",
"keyisexportable": "false",
"keyisversioned": "false",
"keyistemplate": "true"
}
}
response
{
"KeyGenResponse": {
"keyGenResponse": "true"
}
}
Sample SOAP Parameters
For generating a key
<prot:Key_Gen>
<username>cryptouser</username>
<password>qwerty1234</password>
<keyname>testkey</keyname>
<keyalgorithm>AES-256</keyalgorithm>
<keyisdeletable>true</keyisdeletable>
<keyisexportable>true</keyisexportable>
<keyisversioned>true</keyisversioned>
<!--Optional:-->
<keytemplate></keytemplate>
<!--Optional:-->
<keyistemplate>false</keyistemplate>
</prot:Key_Gen>
Output
boolean – indicates if key creation was successful.
<ns1:Key_GenResponse xmlns:ns1="http://dsws.org/protectappws/">true</ns1:Key_GenResponse>
For deleting a key
<prot:Key_Gen>
<username>cryptouser</username>
<password>qwerty1234</password>
<keyname>testkey</keyname>
<keyalgorithm>Del</keyalgorithm>
<keyisdeletable></keyisdeletable>
<keyisexportable></keyisexportable>
<keyisversioned></keyisversioned>
<!--Optional:-->
<keytemplate></keytemplate>
<!--Optional:-->
<keyistemplate></keyistemplate>
</prot:Key_Gen>
Output
boolean – indicates if key is deleted successfully.
<ns1:Key_GenResponse xmlns:ns1="http://dsws.org/protectappws/">true</ns1:Key_GenResponse>