Document of PKI Component
Document of PKI Component
Document of PKI Component
Integration Manual
OverviewofPKIComponent
The (n)Code PKI Component provides line of business application with user
authentication, digital signature & verification for data and files and asymmetric
encryption/decryption based on PKI technologies & X.509 digital certificates. The document
provides procedures and know-how required to PKI enable their application using this
component. This procedure is application in scenarios where the PKI component is installed on a
separate server of its own.
The document contains software & hardware component requirements for the server, description
of various files which needs to be referred by the application, various operations performed by the
PKI Component and descriptions of methods and parameters required to perform these
operations.
Processdescription
Typically, PKI component is used for: 1) User Authentication 2) Data Signing & Verification and
3) File Signing & verification.
User Authentication is carried out using Data Signing procedures. It is required that a certificate is
mapped to the user id of application beforehand. Processes are described in following sections.
Actual integration details will follow these process descriptions.
Database&Schemarequirements
Provisions for storing details generated during the digital signature & verification process should
be made before hand. Following three fields need to be defined in the database:
Sr.No.
Field
Description
Serial Number
Thumb Print
Signed Data
UserCertificatemapping
A. Typically done at time of registration or first login by the user.
B. The user, at the time of registration is presented the certificate selection popup (ActiveX
Control). On selecting the certificate corresponding to the user, the username and
corresponding thumbprint and the serial number along with the signed username are
stored in the database corresponding to the particular user for verification on all
subsequent occasions when the user goes through the above process. The
authentication process expects parameters like serial number of certificate & thumb prints
etc., which are not available at the time of registration.
C. User is presented with a certificate selection applet, which will list down all certificate
passing criteria of allowed certifying authority, validity of dates & presence of complete
certificate chain (CCA India CA ((n)Code Solutions CA) User Certificate.
D. User selects the certificate which is to be used with the application. This certificate must
contain a private key, which will be used for data signing later & should be of correct
class type ( Class II Or III ) as defined by the requirements of application.
E. User ID, passed by the application will be signed using the selected certificate. If the
digital signature operation is completed correctly, the serial number of certificate, thumb
print, the signed data & other parameters will be returned.
F. The application will store the signature, serial number & thumbprint against the user id, in
the database fields, created for this purpose. Required fields are described later in the
document.
UserAuthentication
A. Every time the user logs in after registration, the aim is to identify the user by matching
the signed string, thumbprint and the serial number stored during registration process,
with those obtained from the current process, to carry out authentication. The serial
number & thumb print should be available to the application as an output of the
registration process. The user first enters his username and clicks the login button.
B. The ActiveX PKI Component will display certificate selection to the user. Once the user
selects the certificate, its serial number will be verified against the one provided by the
application.
C. If the serial numbers match, the user id provided by user for login will be signed using the
certificate. It will be matched with the signature provided by the application & the
signatures will be verified.
Data&fileSigning
A. Whenever the data or a file has to be signed digitally, the application will call the ActiveX
Component with required parameters and the data which is to be signed or the physical
path of the file to be signed.
B. The ActiveX PKI component will display certificate selection popup to the user. Once the
user selects the certificate with which the target file will be signed.
C. In case of file signing, a new file with .p7sec extension will be generated at the same
path as that of the original file.
D. All specified parameter will be returned to the calling application.
Data&FileVerification
A. Original data, the signature for the data generated during the digital signature process &
all other required parameters will be passed to the PKI Component on Server Side.
B. In case of file verification, complete physical path of the file which is to be verified is
passed. In this case original file is not required.
C. Extension of the file to be verified must be .p7sec.
D. The data or the file is verified for integrity & authenticity of the data using the public key of
the user who has signed the data/file.
E. If the verification is successful, success flag is returned along with other data to the
calling application.
F. In case of file, the extension .p7sec can be optionally removed and the file is restored
with the original extension.
Parameter
Variable Name
Data Type
Mandatory?
AKI
String
Certificate class
Class
String
Yes.
SerialNumber
String
No
Note: For the first time when user logs in, use MapCertificate function and pass only AKI
parameter inside the function. Function will give pop up to the end user/customer for certificate
selection. After the successful login map/store users certificate serial number and thumbprint of
particular user in the database.
For consecutive login use MapCertificate function and along with AKI pass the serial number
stored in the database and the function will automatically map the certificate at the time of login
without any pop-up to the user/customer.
At the time of next login component would check for the certificate in the clients certificate with its
private key exists, chain exists, time validity exists in MapCertificate function.
Note: In MapCertificate function pass 0 for both Class2 & Class 3 certificate.
Pass 1 for Class2 certificate only & pass 2 for Class3 certificate only.
Sr.No.
Parameter
Variable Name
Data Type
Mandatory?
Data to be signed
SignData
String
Yes
Method of Signing
method
Integer
Yes
AKI
String
Yes ( (blank
string in case of
data signing))
Cert Number
CertNumber
Text
No. Defaults to
null.
SelectionBox
SelectBox
boolean
No. Defaults to
True.
CreateSignFile
boolean
No. Defaults to
false.
After SignAnyData function certain other customers certificate properties will be returned
as follows:a.)
b.)
c.)
d.)
e.)
f.)
g.)
h.)
i.)
Filesigning
Sr.No.
Parameter
Variable Name
Data Type
Mandatory?
File Path
FilePath
String
Yes
Method of Signing
method
Int
Yes.
(0
for
Attached Signing,
1 for Detached
Signing)
AKI
String
Yes ( (blank
string in case of
data signing))
Cert Number
CertNumber
Text
No. Defaults to
null.
SelectionBox
SelectBox
boolean
No. Defaults to
True.
CreateSignFile
boolean
Yes.
Dataverification
Sr.No.
Parameter
Variable Name
Data Type
Mandatory?
Data to be Verified
StrHash
String
Yes
Original Content
StrContent
String
Mandatory
for
detached signing.
Non-mandatory
for
attached
signing.
Method of Verification
method
Int
No
Cert Validity
CertValid
boolean
Cert Display
CertDisp
boolean
Defaults to No.
(Yes for display
Signing
Certificate.)
Fileverification
Parameter
Variable Name
Data Type
Mandatory?
StrHash
String
Yes
Original Content
filepath
String
Mandatory
for
detached signing.
Non-mandatory
for
attached
signing.
Method of Verification
Method
int
0 for Attached, 1
for
Detached
signing.
Cert Validity
CertValid
boolean
Cert Display
CertDisp
boolean
Defaults to No.
(Yes for display
Signing
Certificate.)
killfile
boolean
No. Defaults to
false.
Parameter
Variable Name
Data Type
Mandatory?
Data To Be Encrypted
strData
String
Yes
CustSerialNumber
String
No.
SelectionBox
selectBox
Boolean
No. (Defaults to
False.)
Note: User can store all the properties returned into its database as per requirement for
future use.
DataDecryption
DecryptAnyData(strEnc As String, Serial As String) As String
Sr.No.
Parameter
Variable Name
Data Type
Mandatory?
Encrypted Data
strEnc
String
Yes
Serial Number
Serial
String
Yes
Parameter
Variable Name
Data Type
Mandatory?
Path of file
filepath
String
Yes
CertNumber
String
Yes
Select Box
selectBox
Boolean
No.
Note: EncryptAnyFile function will create an encrypted file with .enc extension.
Also, after file encryption certain other certificate properties will be returned as follows:1.)
2.)
3.)
4.)
5.)
6.)
7.)
8.)
Parameter
Variable Name
Data Type
Mandatory?
Encrypted File to be
Decrypted (Full Path)
strEnc
String
Yes
Path of File
filepath
String
No
Note: DecryptAnyFile function will decrypt file and create the original file.
Technicalrequirements
ServerRequirements
Sr.No.
Component
Supported Platforms
Operating System
Windows
Server/Windows
Server
Web/Application Server
2000
2003
ClientRequirements
Sr.No.
Component
Supported Platforms
Operating System
Windows 2000/2003/XP/VISTA
Browser
IE 6.0/7.0
ProcessofusingPKISigningComponentwithApplication
(n)Code Solutions PKI Signing Component is an ActiveX Control that has to be integrated with
any web application .The component can be used for Data/Form signing and verification and File
singing and verification purpose.
In order to provide better control over the process it is desirable that every user of the application
is mapped to a unique certificate and the use of certificate is restricted by checking the serial
number and thumbprint stored in the database with the one used for singing or verification
operations.