Generate Hash for Code Signing

This API is used to generate a hash for code signing. It creates cryptographic hash values for code files. That serves as a unique fingerprint, ensuring data integrity and security during code signing processes, which are crucial for verifying the authenticity and trustworthiness of the code.

URL: /code-sign-generate-hash

Type: POST

Parameters
Table 1. Parameter Details
Param Type Name Description Field Type
Header sessionId Session ID received after login. String
Header username AppViewX login username. String
Header password AppViewX login password. String
Payload signingPolicy Enter the signing policy for code signing. String
Payload signingKey Enter the signing key for code signing. String
Payload versionNumber Enter the version number for code signing. String
Payload description Description of the hash generation. String
Payload signedType Select the code signed type. String
Payload fileHashContent Enter the hash file content. String

Possible Response Message and Code

HTTP Code appStatusCode Description Response Message
200 null OK Successful
403 CODE_SIGNING_0032 Forbidden Permissions are not there to sign the hash of a file
500 CODE_SIGNING_0062 Internal Server Error Ip provided is invalid
500 CODE_SIGNING_0083 Internal Server Error The retrieved IP address is not valid. The selected policy does not support the obtained IP address.
500 CODE_SIGNING_0063 Internal Server Error Your chosen signing type is not supported by the selected policy
500 CODE_SIGNING_0056 Internal Server Error Signing Policy Info is not present in the Database for the given input
500 CODE_SIGNING_0070 Internal Server Error Signing Key is not mapped to the given policy.
500 CODE_SIGNING_0073 Internal Server Error Certificate is not present in the cert inventory
500 CODE_SIGNING_0021 Internal Server Error Error in updating the signed data
500 CODE_SIGNING_0066 Internal Server Error Failed to convert to json string
500 CODE_SIGNING_0067 Internal Server Error Failed to encrypt
500 CODE_SIGNING_0020 Internal Server Error Error in generating the signed file

Sample Request/Response

Use Case

To generate a hash for code signing using code-sign-generate-hash API.

Request URL

http://pe-sign-apvx-n5.lab.appviewx.net:30001/avxapi/code-signing-generate-hash?gwsource=external

Request Payload
{
    "payload": {
     "signingPolicy" : "Test_Policy_01",
     "signingKey" : "Google CA Code Signing Certificate_Demo=A5:09:C1:6C:3F:72:81:61:59:3A:58:EA:ED:33:11:ED:64:91:DC",
     "versionNumber" : "v1",
     "description" : "Hash Signing",
     "signedType" : "Hash Based Signing",
     "fileHashContent" : "MDEwDQYJYIZIAWUDBAIBBQAEIPw9hz6RJNKrng4tnsFCUGKXA6qAyxRe2kFVOjdpfTMw"
    }
}
Response
{
    "response": "gutIcFnlzbTT7slB1wrOAbMPzhgFszs8nA1DpMLE/7BcAP39vbgIOCIj1rlmM6bSnBl1bJ3U3CMSWqphEu8KzN9gcCknGTyAOJxEiIXOmi0P9ernL4knxoGnDe//89/rC3drt4XqLahHF7mMKrXLCLGqg0UTpOzUM0ZxQTucz4Z2iWipH3R3wNq4gYB4EijPXkp+7D0Q2PGaIiy9/1LhGzwvappbqU9QBFu3Nkr40jepEs7dGcEFYlw4E1spH+gcJsFEAN1H3UToP6zDiBSEq0ZiwXj0mU+pJGxIG49x7jOaDJgAS+p6/ll9eulwRk7Ft4NXoXwWkvYZTx2HAMz0mg==",
    "message": null,
    "appStatusCode": null,
    "tags": null,
    "headers": null
}