API Method - getPKCS12
Purpose
Use the "getPKCS12" method to obtain the PKCS12 data that was previously generated using the "createPKCS12ById" and "createPKCS12" APIs.
Type of Method
POST
Request URL
http://www.example.com/emCAServices/rest/getPKCS12
Request Input Parameters
Parameter
Presence
Data Type
Description
signature
M
String
Generate the Signed data by passing the pfxPin, serialNumber, subscriberId
Example:
{'pfxPin': 'eMudhra@1','serialNumber':'71403fca726c27ca2ac936f3bc3f6c21','subscriberId':'12345'}
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.
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
Process
When request is received by the emCA service, we will decrypt the request JSON Object with same AES key that is shared to the client.
After successful decryption, request JSON object (Signed signature data + Username + Password) is retrieved.
First emCA service will validate username and password and check if the IP Address used for request and registered with the user are same.
If pfx is available with these details then pfx file data will be returned.
If validation fails at any point in processing the request, the emCA service will throw error/failure message. (Refer error messages section)
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 given input based pfx encoded data will be returned
Returns status of the request as failure when invalid data passed or there is an expecption.
result
String
Returns
In case of success: base 64 encoded PKCS12 data
In case of failure: Error message will be displayed.
Response JSON Format
Sample for base 64 encoded x509 certificate data
Error Messages
Error Message
Description
invalid input
If signature does not contain valid data i.e., Username, Password, PFX pin.
Incorrect Subscriber ID / Serial Number
If signature data contains invalid Subscriber ID / Serial Number.
No PKCS12 available for Subscriber ID/Serial Number
If no certificate is available for requested certificate Subscriber ID / Serial Number.
Last updated