Qt based Cross-Platform YubiKey Personalization Tool
====================================================
See the file COPYING for copyright and license statement.

Introduction
------------

The YubiKey Personalization Tool is a Qt based Cross-Platform utility
designed to facilitate re-configuration of YubiKeys on Windows, Linux
and Mac platforms. The tool provides a same simple step-by-step
approach to make configuration of YubiKeys easy to follow and
understand, while still being powerful enough to exploit all
functionality both of the YubiKey 1 and YubiKey 2 generation of
keys. The tool provides the same functionality and user interface on
Windows, Linux and Mac platforms.

The Cross-Platform YubiKey Personalization Tool provides the following
main functions:

	* Programming the YubiKey in "Yubico OTP" mode
	* Programming the YubiKey in "OATH-HOTP" mode
	* Programming the YubiKey in "Static Password" mode
	* Programming the YubiKey in "Challenge-Response" mode
	* Programming the NDEF feature of the YubiKey NEO
	* Testing the challenge-response functionality of a YubiKey
	* Deleting the configuration of a YubiKey
	* Checking type and firmware version of the YubiKey

	
Building from Git
-----------------

You may check out the sources using Git with the following command:

-----------
  $ git clone https://github.com/Yubico/yubikey-personalization-gui.git
-----------

This will create a directory 'yubikey-personalization-gui'. Enter the
directory:

-----------
  $ cd yubikey-personalization-gui
-----------


Dependencies
------------

yubikey-personalization-gui depends on version 1.14.0 or higher of
libykpers.

When building on Windows and mac you will need a binary build of
https://developers.yubico.com/yubikey-personalization[yubikey-personalization],
the contents should then be places in libs/win32, libs/win64 and libs/macx
respectively.

For building on linux pkg-config is used to find these dependencies.

-----------
  $ sudo apt-get install libusb-1.0-0-dev qt4-qmake libykpers-1-dev \
      libyubikey-dev libqt4-dev
-----------

Command-line build
------------------

Run these commands:

-----------
  $ qmake && make
-----------

Cross Compiling from Linux
--------------------------

The project can be cross compiled from linux for OS X and Windows. As
a first step you need a cross-compiler chain for that OS, for windows
you want mingw-w64.

Then you need unpacked http://qt-project.org[Qt binaries] for that platform.

You can then do (for Windows):
TARGET_ARCH=i686-w64-mingw32 QTDIR=<qt location> qmake \
  -spec win32-g++-4.6 "CONFIG+=cross"

To build installers you can add build_installer to the CONFIG variable
for qmake. This requires makensis to be in path for windows and
genisoimage and dmg (from libhfs-dmg) for Mac.


Opening the project in Qt designer
----------------------------------

Locate the qtcreator executable file and click on it to open the Qt
Designer.

To open the project in Qt Designer, select 'File' > 'Open File or
Project' from the tool bar, navigate to the project folder, select
YKPersonalisation.pro file and click on the 'Open' button.

To set the path of the 'Build' diractory select 'Projects' > 'Build
Settings' Browse project folder path.


Building 
--------

To generate the build system, select 'Build' > "Clean Project
YKPersonalization" option from the tool bar. Then select 'Build' >
'Run qmake' option from the tool bar.

To build the project, select 'Build' > 'Build Project
YKPersonalization' option from the tool bar.

Based on your platform, the successful build will create a 'YubiKey
Personalization Tool' executable file into the respective build
folder. The build creates a `YKPersonalization.exe` file on Windows,
`YubiKey Personalization Tool.sh` file on Linux and `YubiKey
Personalization Tool.app` file on Mac.

Example on Linux:
To run the YubiKey Personalization Tool, open the command shell and
execute the following command:

[source, sh]
-----------
  $ build/release/yubikey-personalization-gui
-----------
