Yubico Forum https://forum.yubico.com/ |
|
one library API for several operating systems https://forum.yubico.com/viewtopic.php?f=4&t=598 |
Page 1 of 1 |
Author: | cornelinux [ Mon Nov 22, 2010 4:09 pm ] |
Post subject: | one library API for several operating systems |
Dear forum members, I got an authentication backend doing 2 factor authentication and one time passwords. I'd like to do the personalization of the yubikey directly from within my application. I am used to do it with smartcards where you got the pkcs11 interface. In the pkcs11 case you can write one code with one kind of API calls, that might run on windows, linux and maybe on mac os if the pkcs11 library is available for those operating systems. I took a glance at the personalization tool code under linux and it looks like, that there is no such library for the yubikey. The personalization tool for linux e.g. defines all the functions by itself: Code: yk_init() is not defined in a library but in ykpers.c. yk_write_config() ... and so on and so on. Wouldn't it be easier to define those "top-level" function in a yubikey library that would be available for linux and windows... (at least easier for me If I missed something at this point, I am happy to be pointed to the right direction. Kind regards Cornelius |
Author: | samir [ Wed Nov 24, 2010 4:17 pm ] |
Post subject: | Re: one library API for several operating systems |
A Yubico Personalization Library which can be complied on Linux, MAC and Windows platform already exists. The Library can be found at the link below: http://code.google.com/p/yubikey-personalization/ Yubico is also working on a unified user interface to reprogram the YubiKey which will work on all Linux, MAC and Windows platform. We will update you once it is available. |
Author: | cornelinux [ Wed Nov 24, 2010 5:54 pm ] |
Post subject: | Re: one library API for several operating systems |
Hi Samir, thanks for your reply. Maybe I get something wrong or maybe I am not the double plus perfect C programmer. (At least I know the last is true Obviously this is exactly what is used for the ubuntu package yubikey-personalization. And the functions of interest are contained in the ykpers.c file. Which will be compiled and statically linked into the command line tool ykpersonalize. But I do not want to compile these functions statically but I'd rather use a shared library. In fact, i can not compile it into my project, since it is a python programm. And there I'd like to use a .so or .dll. And I'd like to do the same function calls for Linux and Windows. When I take a look at ykpersonalize.c to get an idea which functions need to be called, those functions are not contained in any shared lib. I modified a ykpersonalize.c this way, to make it easy in some simple steps to enroll a YK with HOTP without userinteraction - this would be: Code: yk_init() yk = yk_open_first_key() yk_get_status(yk, st) yk_check_firmware_version(yk) ykp_configure_for(cfg, 1, st) ykp_set_tktflag_OATH_HOTP(cfg, true) ykp_write_config(cfg, writer, stderr) yk_write_config(yk,ykp_core_config(cfg), ykp_config_num(cfg),use_access_code ? access_code : NULL) done. Again, I'd like to have those necessary functions in a shared lib (so/dll). What do you think about this? Kind regards Cornelius Kind regards Cornelius |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |