ykman.scripting

Classes

ScriptingDevice

Scripting-friendly proxy for YkmanDevice.

Functions

single(*[, prompt])

Connect to a YubiKey.

multi(*[, ignore_duplicates, allow_initial, prompt])

Connect to multiple YubiKeys.

single_nfc([reader, prompt])

Connect to a YubiKey over NFC.

multi_nfc([reader, ignore_duplicates, allow_initial, ...])

Connect to multiple YubiKeys over NFC.

Module Contents

class ykman.scripting.ScriptingDevice(wrapped, info)[source]

Scripting-friendly proxy for YkmanDevice.

This wrapper adds some helpful utility methods useful for scripting.

__getattr__(attr)[source]
__str__()[source]
property info: yubikit.management.DeviceInfo
Return type:

yubikit.management.DeviceInfo

property name: str
Return type:

str

otp()[source]

Establish a OTP connection.

Return type:

yubikit.core.otp.OtpConnection

smart_card()[source]

Establish a Smart Card connection.

Return type:

yubikit.core.smartcard.SmartCardConnection

fido()[source]

Establish a FIDO connection.

Return type:

yubikit.core.fido.FidoConnection

ykman.scripting.single(*, prompt=True)[source]

Connect to a YubiKey.

Parameters:

prompt – When set, you will be prompted to insert a YubiKey.

Return type:

ScriptingDevice

ykman.scripting.multi(*, ignore_duplicates=True, allow_initial=False, prompt=True)[source]

Connect to multiple YubiKeys.

Parameters:
  • ignore_duplicates (bool) – When set, duplicates are ignored.

  • allow_initial (bool) – When set, YubiKeys can be connected at the start of the function call.

  • prompt (bool) – When set, you will be prompted to insert a YubiKey.

Return type:

Generator[ScriptingDevice, None, None]

ykman.scripting.single_nfc(reader='', *, prompt=True)[source]

Connect to a YubiKey over NFC.

Parameters:
  • reader – The name of the NFC reader.

  • prompt – When set, you will prompted to place a YubiKey on NFC reader.

Return type:

ScriptingDevice

ykman.scripting.multi_nfc(reader='', *, ignore_duplicates=True, allow_initial=False, prompt=True)[source]

Connect to multiple YubiKeys over NFC.

Parameters:
  • reader – The name of the NFC reader.

  • ignore_duplicates – When set, duplicates are ignored.

  • allow_initial – When set, YubiKeys can be connected at the start of the function call.

  • prompt – When set, you will be prompted to place YubiKeys on the NFC reader.

Return type:

Generator[ScriptingDevice, None, None]