Code Signing Get Added Keys for Policy

The "Code Signing Get Added Keys for Policy" API allows users to retrieve the keys added to a specified code signing policy. It enables developers and administrators to access the list of cryptographic keys associated with a particular policy, facilitating seamless management and configuration of code signing processes.

Before you begin

  • Configure the signing policy with relevant details, ensuring mapping to the enrolled certificate (also identified as the signing key on the signing policy page).
  • Ensure that the requested keys are included in the policy.

Request Structure

Endpoint: /code-signing-get-added-keys-for-policy
Type: POST
Sample URL: https://<Tenant_name/Host_name>:<portno>/avxapi/code-signing-get-added-keys-for-policy?gwsource=external
Content-Type: application/json
Table 1. Input Parameter
Name Description
Token

String

(header)
(Mandatory) Use token retrieved from login API.

Example: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJwbGF0Zm9y bSIsImF1ZCI6ImF2eCIsImNsaWVudElkIjoiOTcwNzRlNDEtOGFmOS00NTZkLTlhNjQtZjB jNGJiOTA4MDQ4IiwiaXNzIjoiYXZ4IiwiZXhwIjoxNjUwMzY5MzY3LCJncmFudCB0eXBlIj oiY2xpZW50X2NyZWRlbnRpYWxzIn0.HZnkuUEjXIeqJWqpqi NWFHqIDI7GYf4cWx 6VwbjGD_0

sessionId

String

(header)
(Mandatory) After successfully logging in, a unique identifier assigned to a user's session after successful authentication. The session ID remains valid until it expires. The session ID is a string value.

Example: "ce7f1a14-2bf9-4e4a-89a8-bc780a255813"

username

String

(header)
(Mandatory) AppViewX login username, represented as a string value.

Example: "User"

password

String

(header)
(Mandatory) AppViewX login username, represented as a string value.

Example: "AppViewX@123"

gwsource

String

(query)
(Mandatory) Source from which the request is triggered. The values can be:
  • web
  • external

Type: String

policyName

String

(Payload)
(Optional) Policy Name is utilized to retrieve all keys associated with a specific signing policy.

Example: "FileBasedPolicy"

Response Structure

  • Status Code: 200 OK
  • Message: null
  • Headers:
    • Content-Type: application/json
Table 2. Response Parameters
Name Description
response Contains the response attributes for the get added keys for policy request.
message Success message or failure description in case of error.
appStatusCode Application specific status code for the response. Will be non-null for failure response.
tags More info in case of failure response.

Status Codes

HTTP Code appStatusCode Response Message
200 OK - null
400 Bad Request VALIDATION_ERROR_0004 Invalid 'policyName'
400 Bad Request CODE_SIGNING_00240 Policy does not exist
400 Bad Request VALIDATION_ERROR_0004 'policyName' should have at least '5' characters
403 Forbidden CODE_SIGNING_0035 Permissions are not there to get the policy signing keys data.
500 Internal Server Error CODE_SIGNING_0009 Get Signing Keys Operation Failed for the given policy.

Sample Request/Response

Use Case

This API is intended to fetch details regarding all the mapped keys for a particular policy using policy name.

Request URL
https://<Tenant_name/Host_name>:<portno>/avxapi/code-signing-get-added-keys-for-policy?gwsource=external
Request Payload
{
  "payload": {
    "policyName": "FileBasedPolicy"
  }
}
Sample Response
{
  "response": {
    "data": [
      {
        "keyName": "AppViewXCertificate",
        "keyType": "RSA",
        "expirationDate": "12/10/2025",
        "caName": "AppViewX Intermediate CA",
        "keyId": "6757d579b1b426758a12abf9",
        "serialNumber": "0F:63:61:90:16:F5:5D:0B:BA:87:46:89:6C:F2:BC:4B",
        "defaultKey": false,
        "certificateHash": "73e72a34aa9b0903f1bc7996f5ac28050443a8df2bf3b0e56ea225ba7c30008c",
        "groupName": "Default"
      }
    ],
    "iTotalDisplayRecords": 1,
    "keyId": "6757d579b1b426758a12abfa",
    "totalCount": 0
  }
}

Reference

Understanding the sample URL:
  • IP/HostName/TenantName: Replace with the actual IP address, hostname, or tenant name based on the specific configuration in AppViewX.
    • IP: A unique identifier assigned to each device connected to a computer network that uses the Internet Protocol for communication

      The IP address will be included in the endpoint URL for an on-prem deployment.

    • HostName: A human-readable label assigned to a device (host) on a network

      The hostname will be included in the endpoint URL for an on-prem deployment.

    • TenantName: An identifier label for a tenant given to indicate which tenant's data the API request will access/modify

      The tenant name will be included in the endpoint URL for a SaaS deployment.

  • GWPORT: AppViewX gateway port

    A gateway port refers to a network port through which data is sent and received to communicate with a gateway in an on-prem deployment.

    Example: 31443

  • avxapi: Path parameter value (static) that is part of the endpoint's URL
  • Endpoint: Endpoint of the API, for example: execute-hook
  • gwsource: Source or origin of a gateway, for example: external.