yubikit.yubiotp
Attributes
Classes
Enum where members are also (and must be) ints |
|
Enum where members are also (and must be) ints |
|
Support for integer-based Flags |
|
Support for integer-based Flags |
|
Support for integer-based Flags |
|
Enum where members are also (and must be) ints |
|
Support for integer-based Flags |
|
The configuration state of the YubiOTP application. |
|
A session with the YubiOTP application. |
Module Contents
- yubikit.yubiotp.T
- class yubikit.yubiotp.SLOT[source]
Bases:
enum.IntEnum
Enum where members are also (and must be) ints
- ONE = 1
- TWO = 2
- class yubikit.yubiotp.CONFIG_SLOT[source]
Bases:
enum.IntEnum
Enum where members are also (and must be) ints
- CONFIG_1 = 1
- NAV = 2
- CONFIG_2 = 3
- UPDATE_1 = 4
- UPDATE_2 = 5
- SWAP = 6
- NDEF_1 = 8
- NDEF_2 = 9
- DEVICE_SERIAL = 16
- DEVICE_CONFIG = 17
- SCAN_MAP = 18
- YK4_CAPABILITIES = 19
- YK4_SET_DEVICE_INFO = 21
- CHAL_OTP_1 = 32
- CHAL_OTP_2 = 40
- CHAL_HMAC_1 = 48
- CHAL_HMAC_2 = 56
- class yubikit.yubiotp.TKTFLAG[source]
Bases:
enum.IntFlag
Support for integer-based Flags
- TAB_FIRST = 1
- APPEND_TAB1 = 2
- APPEND_TAB2 = 4
- APPEND_DELAY1 = 8
- APPEND_DELAY2 = 16
- APPEND_CR = 32
- PROTECT_CFG2 = 128
- OATH_HOTP = 64
- CHAL_RESP = 64
- class yubikit.yubiotp.CFGFLAG[source]
Bases:
enum.IntFlag
Support for integer-based Flags
- SEND_REF = 1
- PACING_10MS = 4
- PACING_20MS = 8
- STATIC_TICKET = 32
- TICKET_FIRST = 2
- ALLOW_HIDTRIG = 16
- SHORT_TICKET = 2
- STRONG_PW1 = 16
- STRONG_PW2 = 64
- MAN_UPDATE = 128
- OATH_HOTP8 = 2
- OATH_FIXED_MODHEX1 = 16
- OATH_FIXED_MODHEX2 = 64
- OATH_FIXED_MODHEX = 80
- OATH_FIXED_MASK = 80
- CHAL_YUBICO = 32
- CHAL_HMAC = 34
- HMAC_LT64 = 4
- CHAL_BTN_TRIG = 8
- class yubikit.yubiotp.EXTFLAG[source]
Bases:
enum.IntFlag
Support for integer-based Flags
- SERIAL_BTN_VISIBLE = 1
- SERIAL_USB_VISIBLE = 2
- SERIAL_API_VISIBLE = 4
- USE_NUMERIC_KEYPAD = 8
- FAST_TRIG = 16
- ALLOW_UPDATE = 32
- DORMANT = 64
- LED_INV = 128
- yubikit.yubiotp.TKTFLAG_UPDATE_MASK
- yubikit.yubiotp.CFGFLAG_UPDATE_MASK
- yubikit.yubiotp.EXTFLAG_UPDATE_MASK
- yubikit.yubiotp.FIXED_SIZE = 16
- yubikit.yubiotp.UID_SIZE = 6
- yubikit.yubiotp.KEY_SIZE = 16
- yubikit.yubiotp.ACC_CODE_SIZE = 6
- yubikit.yubiotp.CONFIG_SIZE = 52
- yubikit.yubiotp.NDEF_DATA_SIZE = 54
- yubikit.yubiotp.HMAC_KEY_SIZE = 20
- yubikit.yubiotp.HMAC_CHALLENGE_SIZE = 64
- yubikit.yubiotp.HMAC_RESPONSE_SIZE = 20
- yubikit.yubiotp.SCAN_CODES_SIZE = 38
- yubikit.yubiotp.SHA1_BLOCK_SIZE = 64
- class yubikit.yubiotp.NDEF_TYPE[source]
Bases:
enum.IntEnum
Enum where members are also (and must be) ints
- TEXT
- URI
- yubikit.yubiotp.DEFAULT_NDEF_URI = 'https://my.yubico.com/yk/#'
- yubikit.yubiotp.NDEF_URL_PREFIXES = ('http://www.', 'https://www.', 'http://', 'https://', 'tel:', 'mailto:',...
- class yubikit.yubiotp.CFGSTATE[source]
Bases:
enum.IntFlag
Support for integer-based Flags
- SLOT1_VALID = 1
- SLOT2_VALID = 2
- SLOT1_TOUCH = 4
- SLOT2_TOUCH = 8
- LED_INV = 16
- yubikit.yubiotp.Cfg
- class yubikit.yubiotp.SlotConfiguration[source]
- is_supported_by(version)[source]
- Parameters:
version (yubikit.core.Version)
- Return type:
- class yubikit.yubiotp.HmacSha1SlotConfiguration(key)[source]
Bases:
SlotConfiguration
- Parameters:
key (bytes)
- class yubikit.yubiotp.KeyboardSlotConfiguration[source]
Bases:
SlotConfiguration
- class yubikit.yubiotp.HotpSlotConfiguration(key)[source]
Bases:
KeyboardSlotConfiguration
- Parameters:
key (bytes)
- class yubikit.yubiotp.StaticPasswordSlotConfiguration(scan_codes)[source]
Bases:
KeyboardSlotConfiguration
- Parameters:
scan_codes (bytes)
- class yubikit.yubiotp.YubiOtpSlotConfiguration(fixed, uid, key)[source]
Bases:
KeyboardSlotConfiguration
- class yubikit.yubiotp.StaticTicketSlotConfiguration(fixed, uid, key)[source]
Bases:
KeyboardSlotConfiguration
- class yubikit.yubiotp.UpdateConfiguration[source]
Bases:
KeyboardSlotConfiguration
- class yubikit.yubiotp.ConfigState(version, touch_level)[source]
The configuration state of the YubiOTP application.
- Parameters:
version (yubikit.core.Version)
touch_level (int)
- version
- flags
- yubikit.yubiotp.INS_CONFIG = 1
- yubikit.yubiotp.INS_YK2_STATUS = 3
- class yubikit.yubiotp.YubiOtpSession(connection, scp_key_params=None)[source]
A session with the YubiOTP application.
- Parameters:
connection (Union[yubikit.core.otp.OtpConnection, yubikit.core.smartcard.SmartCardConnection])
scp_key_params (Optional[yubikit.core.smartcard.ScpKeyParams])
- close()[source]
Close the underlying connection.
- Deprecated:
call .close() on the underlying connection instead.
- Return type:
None
- property version: yubikit.core.Version
The version of the Yubico OTP application, typically the same as the YubiKey firmware.
- Return type:
- put_configuration(slot, configuration, acc_code=None, cur_acc_code=None)[source]
Write configuration to slot.
- Parameters:
slot (SLOT) – The slot to configure.
configuration (SlotConfiguration) – The slot configuration.
acc_code (Optional[bytes]) – The new access code.
cur_acc_code (Optional[bytes]) – The current access code.
- Return type:
None
- update_configuration(slot, configuration, acc_code=None, cur_acc_code=None)[source]
Update configuration in slot.
- Parameters:
slot (SLOT) – The slot to update the configuration in.
configuration (SlotConfiguration) – The slot configuration.
acc_code (Optional[bytes]) – The new access code.
cur_acc_code (Optional[bytes]) – The current access code.
- Return type:
None
- set_scan_map(scan_map, cur_acc_code=None)[source]
Update scan-codes on YubiKey.
This updates the scan-codes (or keyboard presses) that the YubiKey will use when typing out OTPs.
- set_ndef_configuration(slot, uri=None, cur_acc_code=None, ndef_type=NDEF_TYPE.URI)[source]
Configure a slot to be used over NDEF (NFC).
- calculate_hmac_sha1(slot, challenge, event=None, on_keepalive=None)[source]
Perform a challenge-response operation using HMAC-SHA1.
- Parameters:
slot (SLOT) – The slot to perform the operation against.
challenge (bytes) – The challenge.
event (Optional[threading.Event]) – An event.
on_keepalive (Optional[Callable[[int], None]])
- Return type: