Developing in C/C++

NOTE: This code is contributed by Geodesic team and is available on as-is basis. Sample C application to test Aadhaar authentication can be downloaded from here.

A sample C client with source code is provided to help the community rapidly develop applications that use Aadhaar authentication. This sample application is written in C for the GeoAmida device and it demonstrates various features of Aadhaar authentication. This application is provided on an "AS-IS" basis and should not be considered as a supported, production strength software. This chapter covers details about downloading and setting up development environment.

Setting up Development Environment

When you download the source distribution from the link above, you get "c-auth-client-source-1.5.zip". Please follow steps below to setup the client as a development environment. These directions are for Linux OS and ARM devices. If you are using Windows or other OS, you may make appropriate modification to the instructions below.

Unzip "c-auth-client-source-1.5.zip" into a directory. You should now see a directory named "c-auth-client-source-1.5" there

Navigate to "c-auth-client-source-1.5" directory. You should see the following listing.

Directory Listing

Dependency Libraries:
libxml >= 2.7.6
openssl >= 0.9.8
Digital Signature Generation requires an additional libraries:
libXslt >= 1.1.24
libxmlsec1 >= 1.2.9

The below DEFINES values are need to modify before compiling:
LICENCE_KEY
UIDAI_PUBLIC_CERITIFICATE
AUA_PRIVATE_CERTIFICATE - Required for Digital Signature

Auth Xml API documentation is available under the doc folder


API Functions

You may use any editor tool (Eclipse, emacs or vim) installed on your development machine and setup the environment variable, LD_LIBRARY_PATH in order to find libraries.

Within "Command Prompt", change directory ("cd") to "c-auth-client-source-1.5

Sample Makefile included in the build for Geoamida and gcc version.
CC = arm-xscale-linux-gnueabi-gcc

On a successful make, you should see the executable file AuthClient.

Run AuthClient. It will generate Auth-XML. During compilation if the "-D XML_SECURITY" flag is set, then the Digital Signature will be created along with Auth Xml.