How to create JSON Object before Encryption
Note:
Create a JSON object before encryption using the following terminology for the presence of each field:
M: Mandatory - The field MUST be present.
O: Optional - The field MAY be present.
Java Code for createCertificate(), createPKCS12(), and createCertificateP7B()
NET Code for createCertificate(), createPKCS12(), and createCertificateP7B()
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
profileName
M
String
Pass Certificate profile name to be used to create x509Certificate
signature
M
String
Pass the signature (signed data) in section 5 i.e., PKCS#7 data
Note:
To generate the signature (sign data) for createCertificate and createCertificateP7B APIs, pass the CSR.
For createPKCS12 API, generate the signature (sign data) by passing the CSR information in the format below.
“CN=Test123~SERIALNUMBER=04f85bdd24773b66e0bf16b0f59194c78855c7ffcb7c3cf40dce71ba4ff1e91~E=test987@test.com~O=eMudhra~OU=ESS~S=KARNATAKA~C=IN~PostalCode=570004~STREET= Bengaluru~ HOUSEIDENTIFIER=3-88~UID=test877~PSEUDONYM=test098~ PHONE=0123456789~TITLE=Mr~2.5.4.4=kumar~rfc822Name=arjun.kb@emudhra.com~dNSName=www.emudhra.com~dNSName=*.emudhra.com~iPAddress=10.80.106.78~iPAddress=10.80.106.79~registeredID=2.10.100.2.4.5~KeyAlogirthmAndSize=RSA-2048~Password=eMudhra@1”
subscriberId
M
String
Pass the Subscriber ID
applicationId
M
String
Pass application ID (For every transaction request unique application id is required)
Java Code for getcertificate
.Net Code for getcertificate
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 signed data (signature) in section 5 i.e., PKCS#7 data
Signed Certificate Serial Number
Jave Code for revoke
.Net Code for revoke
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 Signed Certificate Serial Number
remarks
M
String
Pass your reason for revocation of certificate
revokeMode
M
Integer
Pass the below values
0 for - Unspecified
1 for - Key Compromise
2 for - CA compromise
3 for - Affiliation
4 for - Superseded
5 for - Cessation of operation
9 for - Privilege withdrawn
10 for - AA Compromise
Java Code for verifysignature
.Net Code for verifysignature
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.
Java Code for createCertificateById, createPKCS12ById & createCertificateP7BById
.Net Code for createCertificateById, createPKCS12ById & createCertificateP7BById
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.
ProfileID
M
String
Pass Certificate profile name to be used to create x509Certificate.
signature
M
String
Pass the signed data in section 5 i.e., PKCS#7 data
Note:
To generate the signature (sign data) for createCertificateById and createCertificateP7BById APIs, pass the CSR.
For the createPKCS12ById API, generate the signature (sign data) by passing the CSR information in the format below.
“CN=Test123~SERIALNUMBER=04f85bdd24773b66e0bf16b0f59194c78855c7ffcb7c3cf40dce71ba4ff1e91~E=test987@test.com~O=eMudhra~OU=ESS~S=KARNATAKA~C=IN~PostalCode=570004~STREET= Bengaluru~ HOUSEIDENTIFIER=3-88~UID=test877~PSEUDONYM=test098~ PHONE=0123456789~TITLE=Mr~2.5.4.4=kumar~rfc822Name=arjun.kb@emudhra.com~dNSName=www.emudhra.com~dNSName=*.emudhra.com~iPAddress=10.80.106.78~iPAddress=10.80.106.79~registeredID=2.10.100.2.4.5~KeyAlogirthmAndSize=RSA-2048~Password=eMudhra@1”
subscriberId
M
String
Pass the Subscriber ID.
validity
O
String
Pass the validity in the form of (Days : Hours : Minutes : Seconds)
Days – 36135 (maximum days)
Hours - 23 (max hours)
Minutes - 59 (max minutes)
Seconds - 59 (max seconds)
to create certificate with the given validity.
applicationId
M
String
Pass application Id.
validFrom
O
String
Pass the valid from in the form of (dd:MM:yyyy HH:mm:ss)
to create the certificate.
This parameter only applies if the user certificate profile has ‘Support Customized Validity’.
Java Code for Suspend
.Net Code for Suspend
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 signed data in section 5 i.e., PKCS#7 data
Signed Certificate Serial Number
revokeMode
M
Integer
6 for - Certificate hold (Suspension)
remarks
M
String
Pass your reason for revocation of certificate
Java Code for reinstate
.Net Code for reinstate
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 signed data in section 5 i.e., PKCS#7 data
Signed Certificate Serial Number
remarks
M
String
Pass your reason to reinstate the certificate
Java Code for rekey
.Net Code for rekey
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 signed data in section 5 i.e., PKCS#7 data
Signed CSR Data
remarks
M
String
Pass your Reason to rekey the certificate
serialNo
M
String
Certificate Serial number
applicationId
M
String
Pass application ID.
ValidFrom
O
String
Pass the valid from in the form of (dd:MM:yyyy HH:mm:ss)
to create certificate.
This parameter applies if the user certificate profile has ‘Support Customized Validity’.
Java Code for getCertificateByRequestID
.Net Code for getCertificateByRequestID
Java Code for createCustomCertificateById
.Net Code for createCustomCertificateById
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.
profileID
M
String
Pass Certificate profile name to be used to create x509Certificate.
signature
M
String
Pass the signed data in section 5 i.e., PKCS#7 data
Signed CSR Data
subscriberId
M
String
Pass the Subscriber ID.
validity
O
String
Pass the validity in the form of (Days : Hours : Minutes : Seconds)
Days – 36135 (maximum days)
Hours - 23 (max hours)
Minutes - 59 (max minutes)
Seconds - 59 (max seconds)
to create certificate with the given validity.
sANValues
M
String
Pass sANValues to be used to createCustomCertificateById
Example:
"rfc822Name=test@gmail.com|dNSName=www.e xample.com|iPAddress=127.0.0.1|registeredID=2. 10.100.2.4.5"
Note: If sAN values are not available then pass it as empty string.
Java Code for getExpirySoonCertificate
.Net Code for getExpirySoonCertificate
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 signed data in section 5 i.e., PKCS#7 data
Signed Data will be No. of Days to get the expiry soon certificates.
subscriberId
O
String
Pass the Subscriber ID.
Java code for getProfileinfoByProfilename
.Net Code for getProfileinfoByProfilename
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 signed data in section 5 i.e., PKCS#7 data
Signed data will be user certificate profile name
Java Code for getCertificateProfileList
.Net Code for
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 signed data in section 5 i.e., PKCS#7 data
Signed Data will be CAName
Java Code for createCertificatesByIdWithMultipleCsrData
.Net Code for
Multi-CSR Request PDF
create a PDF format like below, convert it to a base64 encoded string, and then sign the same string to generate the signature, you can follow these steps:
Here 1001, 1002 etc. is csr request id and other data is csr data for specific request id.
Java Code for createeSignCustomCertificateById
.Net Code for createeSignCustomCertificateById
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.
profileID
M
String
Pass Certificate profile name to be used to create x509Certificate.
signature
M
String
Pass the signed data in section 5 i.e., PKCS#7 data
Signed CSR Data
subscriberId
M
String
Pass the Subscriber ID.
validity
O
String
Pass the validity in the form of (Days : Hours : Minutes : Seconds)
Days – 36135 (maximum days)
Hours - 23 (max hours)
Minutes - 59 (max minutes)
Seconds - 59 (max seconds)\
to create certificate with the given validity.
sANValues
M
String
Pass sANValues to be used to createCustomCertificateById
Example:
"rfc822Name=test@gmail.com|dNSName=www.e xample.com|iPAddress=127.0.0.1|registeredID=2. 10.100.2.4.5"
Note: If sAN values are not available then pass it as empty string.
subjectDNOids
M
String
Pass subjectDNOids to be used to createCustomCertificateById
Example: “2.5.4.3|Test~2.5.4.6|India~2.5.4.8|Delhi~2.5.4.7|test~2.5.4.5|77686868687~2.5.4.10|Personal~1.2.840.113549.1.9.1|test@gmail.com~2.5.4.12|test”
validFrom
O
String
Pass the validityFrom in the form of
(dd:MM:yyyy HH:mm:ss)
This parameter applies if the user certificate profile has ‘Support Customized Validity’.
isP7BRequest
M
String
String Pass “true” for p7b Certificate and “false” for .cer Certificate.
applicationId
M
String
Pass application ID.
Java Code for getPKCS12
.Net Code for getPKCS12
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.
Last updated