Yubico / python-yubico

Python code to talk to YubiKeys
https://developers.yubico.com/python-yubico/
BSD 2-Clause "Simplified" License
229 stars 33 forks source link

Flag for setting oath-id #30

Closed axhoffmann closed 9 years ago

axhoffmann commented 9 years ago

Hi,

is there a possibility to set the flag for the oath-id like with the ykpersonalize tool: ykpersonalize -1 -ooath-hotp -ooath-id.

Best Regards Axel Hoffmann

dainnilsson commented 9 years ago

Yes, just set a public id (fixed_string)that is 6 bytes (containing OMP, TT and MUI) when programming the credential, and any wanted configuration flags. The relevant flags are:

OATH_FIXED_MODHEX1 0x10 # First byte in fixed part sent as modhex OATH_FIXED_MODHEX2 0x40 # First two bytes in fixed part sent as modhex OATH_FIXED_MODHEX 0x50 # Fixed part sent as modhex

If you want to set the MUI as ykpersonalize does, using the device serial you need to encode it as BCD.