Add Public Key
POST/v2/actions/targets/:targetId/publickeys
Adds a public key to the target for payload encryption.
The public key is used to encrypt the payload sent to the target when the payload type is set to PAYLOAD_TYPE_JWE.
The public key must be in PEM format and be either an RSA or an EC key.
On a successful addition, a key ID is returned which can not only be used to manage the key (activate, remove),
but also will be used as the kid header in the JWE token sent to the target to indicate which key was used for encryption.
Note that newly added keys are inactive by default. You must activate the key to use it for payload encryption.
Providing an optional expiration date allows you to set a validity period for the key.
After the expiration date, the key will be automatically deactivated and no longer used for payload encryption.
Be sure to activate a new key before the current active key expires to avoid interruptions in your target executions.
You can have multiple inactive keys for rotation purposes, but only one active key at a time.
Required permission:
action.target.write
Request​
Responses​
- 200
- 403
- 404
- default
Public key added successfully
Returned when the user does not have permission to access the resource.
Returned when the resource does not exist.
An unexpected error response.