API Method - verifySignature

Purpose

Use the “verifySignature” method for validating the signature.

Type of Method

POST

Request URL

http://www.example.com/emCAServices/rest/verifySignature

Request Post data Input Parameters

Parameter

Presence

Data Type

Description

userName

M

String

You need to pass username that is registered with emCA for API process.

password

M

String

You need to pass the password that is registered with emCA for API process.

signature

M

String

Pass the signature (signed data) in section 5 i.e., PKCS#7 data generated based on the TBS.

Sample JSON Object

Parameter

Presence

Data Type

Description

requestData

M

String

All the request input parameters mentioned above should be converted to JSON object and encrypted with AES 256 key shared with you by the emCA team.

Pass Encrypted JSON Object.

userName

M

String

You need to pass username that is registered with emCA for API process.

Header Details

Key

Presence

Value

Description

Application / JSON

M

Content-Type

Type of request should be in JSON Format.

Authentication Key

M

emKey

emKey is an encoded key (Refer section 4 for generating Authentication Key using command prompt).

Sample Request Data

Header:
Content-Type : application/json
emKey                    : 47b54594063957de22fce0aeddd51a6adf4a80aa
 
 
Request Body:
 
 
{
"requestData" :
"Q/5rvKIZvoMfuZQnysxcGawX4wC1xRttkCHEExreOwUCltgPG0FmsAbEmNHgHvdM2A7Vadyks2IDACyd ZDRG9rS/uq93IO3KMAyazof7IJXz31c3LiXorwiRksUFOrH2IqYbqI1q88Sf3rnxoTdq8oaOzYB2LoNPh 8dZihJyDIR33BccF1Dg/sS/UAwxJ3fjbPzRJpFcqhi2FX1IS8TxyW2PZtPyLtSddyDFxliryGv8RMmVem 6NdJYeNHcYo82qHtszdepvIWCi/DLCqs1alR9TcOsKQ8skBTUQY5xfiuONm68zytXBlF+MIAB40Wsw/12 zywoCe2z14wqA/mvzF6Jd/Cw3059NfW8FtmBS502ty4l+kSDallVUCSFP9b9Drsh4q/giwT+zHa/SQ3LW CFkjDLaB/OMzMaZfAFwm27/mDB4mSWVMPzMo8CDBvNNNekeV6lSeKSJ7rEbR2JJYIeLzQFp++Dvnp0KZH Zu5r+muXAPFCnsDj3MbLrpvbdl3VYKjtDCu0MXi/LX787pStPvr9coMmHTCwja5p7RwI7Ji/nbOnVpT8f 2ylx/Rq7vTFRGAqnFmEK5HAkN6Owdf/dKaKUtifXzJqgjYft0NS7uoXbEJWbb4I86AqLhsPbqqN2zlOXZ IaYLvkoleo//gAcevv6ZS3jk5rkhueR44ablyv5nhgQ25Fhg5cqu4hxUBOi1MRXk5RpA6RZkaz+DPGSsJ J4+yKzTEnxhUZvnqzeFEf1cvIU3Fx9PLmvrQ50cE28AdNu749WOUyjq/eZCFC1rmY6KyThU4ng49S+iqC rUiIIF+McgjbuVPRvy0M9eYi9HpVOduV7XEI2zrRLpID0ueVwo/j6XePsofLvk/5J/xT9S8Ge6wgVNQzk O47eLi2VEPf5OXRopBaSLFZ1SPIgBVumlSnPgLfdNVOirJjhqMyADZrXgoAw3c+YTqRhsRDAhtPKx90Qt w643eLEi/1ujz9ZxB6yzTvFYnh05eaM+N08QVlEJcS+z84vqnY6/+8746T6Ct/tDrLdFCNVvveSEPVCuj bE6LI6pzAnNuHWZoFYoDjANRTDuS8m3LY3mcC24cTJnNTt7a/hF6IsUj0ygfVctkpATXvW9p1m4p6BpYm XFSP6w0nMvKnHd+Uy2R3qykk/1R6YoZbaG9dM3LrAqqAILkYNucL32xZCbSSKX6HIQtZ0WMAfTubYXLsD nAZCLeph1P+fjnkbgrpizkQg==",
"userName" : "username"
 
 
}

Process

  • When a request is received by the emCA service, we will decrypt the request JSON Object with the same AES key that is shared to the client.

  • After successful decryption, request JSON object (Signed data + Username + Password) is retrieved.

  • First emCA service will validate the username and password and check if the IP Address used for the request and registered with the user are the same.

  • If it is the same then signed data (signature) is validated by trust verification, CRL verification, and expiry.

  • If validation fails at any point in processing the request, the emCA service will throw an error /failure message.

Response Parameters

Parameter

Data Type

Description

response

String

Returns JSON Object

JSON Object Contains below parameters

Parameter

Data Type

Description

status

String

Returns Status of the request as success if signature is successfully validated.

Returns status of the request as failure when authentication fails or unregistered user tries to call the API

result

String

Returns

In case of success: “Signature verified successfully”

message will be displayed.

In case of failure: error message will be displayed

subscriberId

String

Returns Subscriber Id

requestId

String

Returns Request ID null

Response JSON Format

Sample:
Success:
{
"status":"success",
"result":" Signature verified successfully!!!! " "subscriberId": "XXXX",
“requestId”:null
}
Failure:
{
"status":"failure", "result":"<error message>"
"subscriberId": null, “requestId”:null
}

Error Messages

Error Message

Description

Signature Verification Failed

In case of user does not exist.

Last updated