Skip to content
C Makefile Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
b64
doc @ b62546d
m4
rfc4634
tests
.gitignore
.gitmodules
AUTHORS
COPYING
Makefile.am
NEWS
README
configure.ac
simple.mk
tool.c
ykclient.c
ykclient.h
ykclient_server_response.c
ykclient_server_response.h

README

Introduction to Yubikey client C library
========================================

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

This is a library written in C to validate a Yubikey OTP against the
Yubico online server.  Description of included files:

* AUTHORS, COPYING, NEWS, README: meta-information about the project.

* ykclient.h, ykclient.c: Implementation of the library.

* tool.c: Source for command line tool "ykclient" to validate an OTP.

* selftest.c: Self tests of the library.

* simple.mk: Simple makefile to build the above parts.

* configure.ac, Makefile.am: Autoconf/Automake files.


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

Skip to the next section if you are using an official packaged
version.

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

-----------
  $ git clone git://github.com/Yubico/yubico-c-client.git
-----------

This will create a directory 'yubico-c-client'.  Enter the directory:

-----------
  $ cd yubico-c-client
-----------

Autoconf, automake and libtool must be installed.

Generate the build system using:

-----------
  $ autoreconf --install
-----------


Building
--------

To build using the Autoconf, automake and libtool infrastructure,
which is recommend for more advanced purposes especially for
cross-compilation and shared library support, build it as follows.

-----------
  $ ./configure
  $ make check install
-----------

Another way to build the package is by running 'make -f simple.mk
check'.  It will build each component, and also test it.  See below
for sample session.  This is useful if you want to target a platform
that doesn't support Autoconf/automake/libtool well.

-----------
jas@mocca:~/src/yubico-c-client$ make -f simple.mk  check
cc -I. -Wall -g -DPACKAGE=\"ykclient\" -DPACKAGE_VERSION=\"0\"   -c -o ykclient.o ykclient.c
cc -lcurl  ykclient.o tool.c   -o ykclient
cc -I. -Wall -g -DPACKAGE=\"ykclient\" -DPACKAGE_VERSION=\"0\"  -lcurl  selftest.c ykclient.o   -o selftest
./selftest
ykclient_init (0): Success
ykclient_request (2): Yubikey OTP was replayed (REPLAYED_OTP)
yubikey_request (2): Yubikey OTP was replayed (REPLAYED_OTP)
strerror(0): Success
strerror(BAD_OTP): Yubikey OTP was bad (BAD_OTP)
jas@mocca:~/src/yubico-c-client$ 
-----------


Command-line tools
------------------

There is one command line tool, ykclient, to validate a particular
OTP.  It needs a client id, which you can allocate for yourself on
Yubico's web site.

Example session below.

-----------
jas@mocca:~/src/yubico-c-client$ ./ykclient 
Usage: ./ykclient <client_id> <yubikey_otp>
 CLIENT_ID: your client id integer
 YUBIKEY_OTP: One-time password generated by yubikey
jas@mocca:~/src/yubico-c-client$ ./ykclient 16 dteffujehknhfjbrjnlnldnhcujvddbikngjrtgh
Input:
  client id: 16
  token: dteffujehknhfjbrjnlnldnhcujvddbikngjrtgh
Verification output (2): Yubikey OTP was replayed (REPLAYED_OTP)
jas@mocca:~/src/yubico-c-client$ 
-----------


Questions?
----------

Talk to <simon@yubico.com>.
Something went wrong with that request. Please try again.