Showing posts from November, 2009

New Logo for EIDNative project

Ben De Cat made a logo for EIDNative Library:

Thank you Ben! Now EIDNative looks really professional. With support of people like Ben, the development of EIDNative goes really easy and faster.

Belgian eID Middleware SDK 3.5: Delphi edition

Belgian Middleware SDK 3.5 provides set of similar classes for C++, Java and C#, but there is no Delphi support included. In case if you want to use eID SDK from Delphi, I made Delphi wrapper for it with exactly the same classes as it provides for C#. 
For using this wrapper you must have eID Middleware and eID SDK 3.5 installed.

If you want to avoid such dependency you can use EIDNative Library instead.

National Geographic offers nice wallpapers

From National Geographic wallpapers section:

EIDNative Feature Request

Have an idea for a feature? Check out the EIDNative Feature Request Feedback Forum

It allows you to:
 View feature requests submitted by other users, and comment on them. Vote on your favourite feature requests. Submit your own feature requests for possible inclusion in a future release.

EIDNative - ActiveX version (update)

EIDNativeX is updated. I added the export of card readers list to CSV and fixed some problems related to reading of SIS cards.


Accessing managed code from native application

// CLRHost.cpp : Hosting managed code in native Windows application // This demo shows how to access the managed code from the native application // and call the C# class method #include "stdafx.h" #include <mscoree.h> int _tmain(int argc, _TCHAR* argv[]) { CComPtr<iclrruntimehost> pHost; DWORD dRetVal; CorBindToRuntimeEx(NULL, NULL, 0, CLSID_CLRRuntimeHost, IID_ICLRRuntimeHost, (void**)&pHost); pHost->Start(); // Once you've loaded and started the CLR, the easiest way to load and run // your managed code is to use the ExecuteInDefaultApp-Domain //method on ICLRRuntimeHost. This will simply load a managed assembly // and execute a method on it: pHost->ExecuteInDefaultAppDomain(L"TestAssembly.dll", L"Test.MyClass", L"Execute", L"Hello", &dRetVal); pHost->Stop(); return 0; }

EIDNative - release

EIDNative Library version is available for download. EIDNative Library is a freeware SDK for Belgian Electronic ID Card.

Download link:

In this release:
C++ version was rewritten almost from scratchUpdated Delphi versionUpdated Delphi documentationAdded C++ documentationFixed some bugs (thanks to René Boesmans)

How to verify Certificate Revocation using EIDNative library

This example receives the raw certificate date from eID card, then convert the raw data to X509Certificate and uses X509Chain for certificate validation.

using System; using System.Collections.Generic; using System.Linq; using System.Text; using EIDNative; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.IO; namespace Certificates { class Program { static void Main(string[] args) { byte[] rawCertificate; X509Certificate2 certificate; X509Certificate2 caCertificate; X509Certificate2 rootCaCertificate; X509Certificate2Collection certs; EIDCard card = new EIDCard(); card.InitReader(); if (card.IsEIDCard()) { rawCertificate = card.ReadAuthenticationCertificate(); if (rawCertificate.Length > 0) { certs = new X509Certificate2Collection()…

EIDExporter update

The new version of EIDExporter is available for download. EIDExporter is a console application that exports data from Belgian eID or SIS card to CSV text file.

In this version was added the possibility to select card reader, export the list of card readers to CSV file and store picture apart from other eID data.


Run an application under a specific user account

program RunButAs; {$APPTYPE CONSOLE} {$R *.res} uses Windows, SysUtils; var User, Password, Params : WideString; sUser, sPassword : string; function CreateProcessWithLogonW( lpUsername : LPCWSTR; lpDomain : LPCWSTR; lpPassword : LPCWSTR; dwLogonFlags : DWORD; lpApplicationName : LPCWSTR; lpCommandLine : LPWSTR; dwCreationFlags : DWORD; lpEnvironment : pointer; lpCurrentDirectory : LPCWSTR; var lpStartupInfo : TStartupInfoW; var lpProcessInfo : TProcessInformation ) : boolean; stdcall; external 'Advapi32.dll'; procedure ShowHelp; begin writeln('Run an application under a specific user account'); writeln('Copyright (c) 2009, Serhiy Perevoznyk'); writeln; writeln('Usage : ' + ExtractFileName(ParamStr(0)) + ' <user name=""> [<password>] <command line="">'); halt(1); end; const LOGON_WITH_PROFILE = 1; var si : TStartupInfoW; pi : TProcessInformation; hUserToken…

Resampling images in Compact Framework

Resizing the image with good quality result is not simple task in CF, because Graphics InterpolationMode property is not supported. For breaking this limitation I developed a new library with the resampling engine made in C++ for ARM processors and a very simple C# wrapper for it. The engine implements a lot of buit-in filters with different speed and result quality.


The result of the resampling:

The original image dimensions 256x256 and resampled image 48x48


Note: When using this library you must distribute Resample.dll with your application.

Thanks to Carlo Pallini's for his idea of C++ resampling library.

EIDNative - release

EIDNative library is available for download


I added in this release of EIDNative an additional function for waiting when the card is inserted and few functions for exporting data from eID and SIS cards to SCV files - the same as for ActiveX version.
The ideas for these modifications come from Ben De Cat.

An official middleware 3.5 has no compatibility problem with EIDNative. With older versions of middleware EIDNative works using special compatibility mode. In other words, EIDNative does not require the middleware to be installed, but works on PCs with and without the middleware installed. All parts of EIDNative are independent: EIDNativeX (ActiveX version) works without EIDNative, etc...

EIDNative - ActiveX version (update)

I updated an ActiveX version of  EIDNative: fixed ReadSISCard method and added new methods for saving information to CSV file:

SaveIDToCSVSaveAddressToCSVSavePersonToCSVSaveSISDataToCSVNew methods for controlling card reader were added:

GetSelectedReaderIndexSelectReaderByNameSelectReaderWaitForCardInserted method works now not only with eID card, but with SIS card as well.


SIS card hardware limitations

An additional remark about reading SIS cards. Not every type of smart card readers able to read SIS cards.
You can read SIS card by using ACR 38U card reader, for example.

Export data from eID or SIS card to CSV file

I received the following idea from Ben De Cat:

"Nog een idee om het leven van iedereen nog makkelijker te maken, is er geen mogelijk om een (verborgen) commandline applicatie te maken die na aanroep de eiddata wegschrijft naar een csv file..."

 and created a new command-line tool for exporting the data from eID or SIS card to CSV file.

EIDNative - ActiveX version

Recently I received the following message:

"Ik werkte met powerbuilder 10.5 en een activeX van EIDruntime 2.5 om gegevens van EID te lezen. Sinds runtime versie 3.5 wordt deze activeX (EIDlibctrl) niet meer ondersteund. Ik probeer nu uw native library te laten werken met powerbuilder a.h.v. VB6 voorbeelden, maar heb problemen met de "types" zoals EIDIdentity. Deze worden nl niet ingevuld na oproep functie ReadIDData en krijg geen foutmelding. Powerbuilder werkt met structures i.p.v. types, waarbij dezelfde declaraties gemaakt worden zoals bij EIDIdentity. De volgende functies werken wel: InitReader,DoneReader,IsEIDCard,SavePhotoAsJpeg.
Een idee?? "

For some programming languages, like VB, the direct usage of EIDNative API can be difficult.
Answering some developers requests I created an ActiveX version of EIDNative library for reading the
information stored on Belgian electronic ID card and Belgian SIS card. This ActiveX library has no
dependencies from EIDNative li…