The keys Service

The rest_v2/keys service allows you to list the cryptographic keys that have been added to the server's keystore. The keys in the list are identified by their key alias, the keys themselves are not given. The response never includes the server's own keys that it creates at installation time, only custom keys added to keystore by administrators using the js-import or keytool commands.

For more information about cryptographic keys and how to add them to the keystore, see the JasperReports Server Security Guide.

This service requires system administrator priviliges on the server (jasperadmin for Community Project, superuser for Professional Edition).

Method

URL

GET

http://<host>:<port>/jasperserver-pro/rest_v2/keys/

Options

Response

accept:application/json

A JSON object that lists custom keys, for example:

[
    {"alias": "myCustomKeyAlias", "algorithm": "AES",
     "label": "My Custom Key" }, 
    {"alias": "productionServerKey", "algorithm": "AES"}, 
    {"alias": "testServerKey", "algorithm": "RSA"}
]

Return Value on Success

Typical Return Values on Failure

200 OK – The response contains the custom keys.

204 No Content – When there are no custom keys.

401 Unauthorized – When system administrator credentials are not provided.

You can use the response to create a list of keys available for import or export operations. When present, use the label to display the keys, otherwise use the alias. When specifying keys in import and export operations, specify them by alias. For more information, see The export Service and The import Service.