Swelio 1.5 – Freeware Belgian eID card SDK

The new release of Swelio – freeware Belgian eID card SDK is available for download.

Whats new in this release:

* Fixed some bugs in C++ code
* Updated C++ documentation
* Added Delphi documentation
* Added Microsoft .NET binding

The C# source code of the .NET binding included. The library supports AnyCPU, x86 and x64 projects. It is compatible with .NET Framework 2.0 – 4.5 and tested with all Windows versions starting from Windows XP.
The provided assembly was compiled for .NET Framework 2.0 using Microsoft Visual Studio 2008, but the project can be easily upgraded to the more recent versions of the .NET Framework and Visual Studio. It was done to cover more possible configuration, because the downgrade of the Visual Studio project is not possible. The sample project is also provided.

Please leave your comments or write a review to help me improve the quality and functionality of the Swelio SDK. If you found a bug – please report it to me using the contact form. The future requests from the active testers will be treated with higher priority.

Download Swelio SDK

Introducing Swelio – new library for Belgian eID cards

The freeware Belgian eID cards access library called Swelio is available for download: https://github.com/perevoznyk/swelio-sdk

Features

  • No external dependencies
  • x32 and x64 versions
  • All functions have Unicode and Ansi version
  • Simple to use, easy to embed in any programming language
  • C#, C++ and Delphi SDK with samples and documenation are included
  • Works in Windows XP – Windows 10
  • Provides more than 200 different functions
  • QR codes generation
  • Export card data to XML
  • Multiple readers support
  • Exports photo in different graphical formats
  • No eID Middleware required
  • Hash functions and encryption supported
  • Check of the pin code
  • Can create and verify digital signatures
  • Many other useful things…
  • Additionally, you can use Swelio to sign PDF documents using Belgian eid card: https://github.com/perevoznyk/swelio-pdf
  • EIDNative library version 3.0 is released

    EIDNative – the Belgian eID card access library version 3.0 is available for download: http://sdrv.ms/1jsEPAc
    Now it supports x64 and x32 Windows and can be used from Windows XP to Windows 8. This is the last release of the EIDNative library and it will be not updated in the future, because I made the new more advanced and powerful library for reading electronic id cards and the new library will replace EIDNative.

    Quricol 2.0 – QR Code generator

    The version 2.0 of Quricol – the open source freeware QR code generator library is available for download. 

    Downloadhttp://users.telenet.be/ws36637/download/quricol.zip Based on qrencode library version 3.4.2

    • Added Visual Studio project file and external libraries for easy rebuild of quricol.dll. This was asked by Carlos GutierrezAdded possibility to specify the background and foreground colors of the image
    • Removed reference to qrencode.h from quricol.h header file. Now you have to include only one header file to your C++ project
    • Updated Delphi library, included new demo project
    • Compatible with Ansi and Unicode Delphi versions
    • Can be used with 32 and 64 bit Delphi projects
    • Updated Delphi documentation

    GitHub: https://github.com/perevoznyk/quricol

    Krento becomes Open Source

    The time has come for KRENTO to be released as open source.You can find the source code on Google Code site: https://github.com/perevoznyk/krento
    After 4 years of hard work I understood that I can’t continue the development of such a big project alone. I hope that other developers will show the interest of giving the boost to this project.
    More information about Krento project is available on http://users.telenet.be/serhiy.perevoznyk/krento.html

    Update for Quricol library from Krzysztof Michalowski

    Krzysztof Michalowski modified the code to load library dynamically. This allows you to run a program when there is no library. Here is the code provided to me by Krzysztof.

    unit QuricolCode;
    interface
    
    uses
    
    Windows, SysUtils, Classes, Graphics, Dialogs;
    
    type
    
    TQRCode = class
    
    public
    
    class procedure GenerateBitmap(const FileName : string; const Text : string; Margin : integer = 4; PixelSize : integer = 3);
    
    class procedure GeneratePng(const FileName : string; const Text : string; Margin : integer = 4; PixelSize : integer = 3);
    
    class function GetBitmap(const Text : string; Margin : integer = 4; PixelSize : integer = 3) : TBitmap;
    
    class procedure GetPng(Stream : TStream; const Text : string; Margin : integer = 4; PixelSize : integer = 3);
    
    end;
    
    implementation
    
    { TQRCode }
    
    class procedure TQRCode.GenerateBitmap(const FileName, Text: string; Margin,
    
    PixelSize: integer);
    
    type
    
    TGenerateBMPWProc = procedure (fileName: PWChar; text : PWChar; margin : integer; size : integer); stdcall;
    
    var
    
    dllHandle : cardinal;
    
    generateBMPWProc : TGenerateBMPWProc;
    
    begin
    
    dllHandle := LoadLibrary('quricol32.dll');
    
    if dllHandle 0 then
    
    begin
    
    try
    
    @generateBMPWProc := GetProcAddress(dllHandle, 'GenerateBMPW');
    
    if Assigned (generateBMPWProc) then
    
    generateBMPWProc(PWChar(FileName), PWChar(Text), Margin, PixelSize)
    
    else
    
    ShowMessage('"GenerateBMPW" procedure not found');
    
    finally
    
    FreeLibrary(dllHandle);
    
    end;
    
    end
    
    else
    
    begin
    
    ShowMessage('quricol32.dll not found / not loaded');
    
    end;
    
    end;
    
    class procedure TQRCode.GeneratePng(const FileName, Text: string; Margin,
    
    PixelSize: integer);
    
    type
    
    TGeneratePNGWProc = procedure (fileName: PWChar; text : PWChar; margin : integer; size : integer); stdcall;
    
    var
    
    dllHandle : cardinal;
    
    generatePNGWProc : TGeneratePNGWProc;
    
    begin
    
    dllHandle := LoadLibrary('quricol32.dll');
    
    if dllHandle 0 then
    
    begin
    
    try
    
    @generatePNGWProc := GetProcAddress(dllHandle, 'GeneratePNGW');
    
    if Assigned (generatePNGWProc) then
    
    generatePNGWProc(PWChar(FileName), PWChar(Text), Margin, PixelSize)
    
    else
    
    ShowMessage('"GeneratePNGW" procedure not found');
    
    finally
    
    FreeLibrary(dllHandle);
    
    end;
    
    end
    
    else
    
    begin
    
    ShowMessage('quricol32.dll not found / not loaded');
    
    end;
    
    end;
    
    class function TQRCode.GetBitmap(const Text: string; Margin,
    
    PixelSize: integer): TBitmap;
    
    type
    
    TGetHBitmapW = function (text : PWChar; margin : integer; size : integer): HBITMAP; stdcall;
    
    var
    
    Bmp : HBITMAP;
    
    DIB: TDIBSection;
    
    ScreenDC : THandle;
    
    DC : THandle;
    
    dllHandle : cardinal;
    
    GetHBitmapWFunc : TGetHBitmapW;
    
    begin
    
    dllHandle := LoadLibrary('quricol32.dll');
    
    if dllHandle 0 then
    
    begin
    
    try
    
    @GetHBitmapWFunc := GetProcAddress(dllHandle, 'GetHBitmapW');
    
    if Assigned (GetHBitmapWFunc) then
    
    Bmp := GetHBitmapWFunc(PWChar(Text), Margin, PixelSize)
    
    else
    
    ShowMessage('"GetHBitmapW" function not found');
    
    finally
    
    FreeLibrary(dllHandle);
    
    end;
    
    end
    
    else
    
    begin
    
    ShowMessage('quricol32.dll not found / not loaded');
    
    end;
    
    GetObject(Bmp, SizeOf(DIB), @DIB);
    
    Result := TBitmap.Create();
    
    Result.Width := DIB.dsBmih.biWidth;
    
    Result.Height := DIB.dsBmih.biHeight;
    
    Result.PixelFormat := pf32bit;
    
    ScreenDC := GetDC(0);
    
    DC := CreateCompatibleDC(ScreenDC);
    
    SelectObject(DC, Bmp);
    
    ReleaseDC(0, ScreenDC);
    
    BitBlt(Result.Canvas.Handle, 0, 0, Result.Width, Result.Height, DC, 0, 0, SRCCOPY);
    
    DeleteDC(DC);
    
    DeleteObject(Bmp);
    
    end;
    
    class procedure TQRCode.GetPng(Stream: TStream; const Text: string; Margin,
    
    PixelSize: integer);
    
    type
    
    TGetPNGW = procedure (text : PWChar; margin : integer; size : integer; var bufSize : integer; out ppvBits : PByte); stdcall;
    
    TDestroyBuffer = procedure(Buffer : PByte); stdcall;
    
    var
    
    size : integer;
    
    i : integer;
    
    buffer : PByte;
    
    ps : PByte;
    
    dllHandle : cardinal;
    
    GetPNGWProc : TGetPNGW;
    
    DestroyBufferProc : TDestroyBuffer;
    
    begin
    
    size := 0;
    
    dllHandle := LoadLibrary('quricol32.dll');
    
    if dllHandle 0 then
    
    begin
    
    try
    
    @GetPNGWProc := GetProcAddress(dllHandle, 'GetPNGW');
    
    if Assigned (GetPNGWProc) then
    
    GetPNGWProc(PWChar(Text), Margin, PixelSize, size, buffer)
    
    else
    
    ShowMessage('"GetPNGW" procedure not found');
    
    if (size > 0) then
    
    begin
    
    ps := buffer;
    
    for I := 0 to size - 1 do
    
    begin
    
    Stream.Write(ps^, 1);
    
    inc(ps);
    
    end;
    
    @DestroyBufferProc := GetProcAddress(dllHandle, 'DestroyBuffer');
    
    if Assigned (DestroyBufferProc) then
    
    DestroyBufferProc(buffer)
    
    else
    
    ShowMessage('"DestroyBuffer" procedure not found');
    
    end;
    
    finally
    
    FreeLibrary(dllHandle);
    
    end;
    
    end
    
    else
    
    begin
    
    ShowMessage('quricol32.dll not found / not loaded');
    
    end;
    
    end;
    
    end.
    

    Quricol Delphi sample

    GitHub: https://github.com/perevoznyk/quricol

    Update 11.09.2013: Quricol 2.0 is available for download. More information about this version on http://delphi32.blogspot.com/2013/09/quricol-20-qr-code-generator.html

    program QuricolDemo;
    
    
    
    
    
    
    {$APPTYPE CONSOLE}
    
    
    
    
    
    
    uses
    
    
      SysUtils,
    
    
      Graphics,
    
    
      Classes,
    
    
      QuricolCodeAnsi in 'QuricolCodeAnsi.pas';
    
    
    
    
    
    
    var
    
    
      bmp : TBitmap;
    
    
      MS : TMemoryStream;
    
    
    begin
    
    
      try
    
    
        //Generate Windows bitmap and save to file
    
    
        TQRCode.GenerateBitmap('delphi1.bmp', 'http://delphi32.blogspot.com');
    
    
    
    
    
    
        //Generate PNG image and save to file
    
    
        TQRCode.GeneratePng('delphi1.png', 'http://delphi32.blogspot.com');
    
    
    
    
    
    
        //Generate TBitmap
    
    
        bmp := TQRCode.GetBitmap('http://www.krento.net');
    
    
        bmp.SaveToFile('delphi2.bmp');
    
    
    
    
    
    
        //Generate PNG to the memory stream
    
    
        MS := TMemoryStream.Create;
    
    
        TQRCode.GetPng(MS, 'http://www.krento.net');
    
    
        MS.Position := 0;
    
    
        MS.SaveToFile('delphi2.png');
    
    
        MS.Free;
    
    
    
    
    
    
      except
    
    
        on E: Exception do
    
    
          Writeln(E.ClassName, ': ', E.Message);
    
    
      end;
    
    
    end.
    
    					

    ANSI version of the Quricol Delphi library

    Last year I published the Quricol library for Delphi 2010 or better, but some users still need the support for older Delphi versions. As a result I made an update to Quricol library with support not only the Unicode, but also ANSI Delphi code.

    //===============================================================================
    // Copyright (c) Serhiy Perevoznyk. All rights reserved.
    
    // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
    
    // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
    
    // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
    
    // FITNESS FOR A PARTICULAR PURPOSE.
    
    //===============================================================================
    
    unit QuricolCodeAnsi;
    
    interface
    
    uses
    
    Windows, SysUtils, Classes, Graphics;
    
    type
    
    TQRCode = class
    
    public
    
    class procedure GenerateBitmap(const FileName : string; const Text : string; Margin : integer = 4; PixelSize : integer = 3);
    
    class procedure GeneratePng(const FileName : string; const Text : string; Margin : integer = 4; PixelSize : integer = 3);
    
    class function GetBitmap(const Text : string; Margin : integer = 4; PixelSize : integer = 3) : TBitmap;
    
    class procedure GetPng(Stream : TStream; const Text : string; Margin : integer = 4; PixelSize : integer = 3);
    
    end;
    
    implementation
    
    procedure GeneratePNGA(fileName: PChar; text : PChar; margin : integer; size : integer); stdcall; external 'quricol32.dll';
    
    function GetHBitmapA(text : PChar; margin : integer; size : integer) : HBITMAP; stdcall; external 'quricol32.dll';
    
    procedure GenerateBMPA(fileName: PChar; text : PChar; margin : integer; size : integer); stdcall; external 'quricol32.dll';
    
    procedure GetPNGA(text : PChar; margin : integer; size : integer; var bufSize : integer; out ppvBits : PByte); stdcall; external 'quricol32.dll';
    
    procedure DestroyBuffer(Buffer : PByte); stdcall; external 'quricol32.dll';
    
    { TQRCode }
    
    class procedure TQRCode.GenerateBitmap(const FileName, Text: string; Margin,
    
    PixelSize: integer);
    
    begin
    
    GenerateBMPA(PChar(FileName), PChar(Text), Margin, PixelSize);
    
    end;
    
    class procedure TQRCode.GeneratePng(const FileName, Text: string; Margin,
    
    PixelSize: integer);
    
    begin
    
    GeneratePNGA(PChar(FileName), PChar(Text), Margin, PixelSize);
    
    end;
    
    class function TQRCode.GetBitmap(const Text: string; Margin,
    
    PixelSize: integer): TBitmap;
    
    var
    
    Bmp : HBITMAP;
    
    DIB: TDIBSection;
    
    ScreenDC : THandle;
    
    DC : THandle;
    
    begin
    
    Bmp := GetHBitmapA(PChar(Text), Margin, PixelSize);
    
    GetObject(Bmp, SizeOf(DIB), @DIB);
    
    Result := TBitmap.Create();
    
    Result.Width := DIB.dsBmih.biWidth;
    
    Result.Height := DIB.dsBmih.biHeight;
    
    Result.PixelFormat := pf32bit;
    
    ScreenDC := GetDC(0);
    
    DC := CreateCompatibleDC(ScreenDC);
    
    SelectObject(DC, Bmp);
    
    ReleaseDC(0, ScreenDC);
    
    BitBlt(Result.Canvas.Handle, 0, 0, Result.Width, Result.Height, DC, 0, 0, SRCCOPY);
    
    DeleteDC(DC);
    
    DeleteObject(Bmp);
    
    end;
    
    class procedure TQRCode.GetPng(Stream: TStream; const Text: string; Margin,
    
    PixelSize: integer);
    
    var
    
    size : integer;
    
    i : integer;
    
    buffer : PByte;
    
    ps : PByte;
    
    begin
    
    size := 0;
    
    GetPNGA(PChar(Text), Margin, PixelSize, size, buffer);
    
    if (size > 0) then
    
    begin
    
    ps := buffer;
    
    for I := 0 to size - 1 do
    
    begin
    
    Stream.Write(ps^, 1);
    
    inc(ps);
    
    end;
    
    DestroyBuffer(buffer);
    
    end;
    
    end;
    
    end.
    

    Quricol – QR code generator library

    Quricol is an open source freeware QR code generator library for C++, Microsoft .NET and Delphi based on qrencode – QR Code encoder by Kentaro Fukuchi.The library contains methods to save the generated image to Bitmap or PNG file or generate images on-fly and save it to the stream. Both 32 and 64 bits compiled versions available along with source code.

    Download: http://users.telenet.be/ws36637/download/quricol.zip

    A QR code (abbreviated from Quick Response code) is a type of matrix barcode (or two-dimensional code).

    GitHub: https://github.com/perevoznyk/quricol