yubikit.oath
Attributes
Classes
Enum where members are also (and must be) ints |
|
Enum where members are also (and must be) ints |
|
An object holding OATH credential data. |
|
An OATH code object. |
|
An OATH credential object. |
|
A session with the OATH application. |
Functions
|
Parse Base32 encoded key. |
Module Contents
- yubikit.oath.TAG_NAME = 113
- yubikit.oath.TAG_NAME_LIST = 114
- yubikit.oath.TAG_KEY = 115
- yubikit.oath.TAG_CHALLENGE = 116
- yubikit.oath.TAG_RESPONSE = 117
- yubikit.oath.TAG_TRUNCATED = 118
- yubikit.oath.TAG_HOTP = 119
- yubikit.oath.TAG_PROPERTY = 120
- yubikit.oath.TAG_VERSION = 121
- yubikit.oath.TAG_IMF = 122
- yubikit.oath.TAG_TOUCH = 124
- yubikit.oath.INS_LIST = 161
- yubikit.oath.INS_PUT = 1
- yubikit.oath.INS_DELETE = 2
- yubikit.oath.INS_SET_CODE = 3
- yubikit.oath.INS_RESET = 4
- yubikit.oath.INS_RENAME = 5
- yubikit.oath.INS_CALCULATE = 162
- yubikit.oath.INS_VALIDATE = 163
- yubikit.oath.INS_CALCULATE_ALL = 164
- yubikit.oath.INS_SEND_REMAINING = 165
- yubikit.oath.TOTP_ID_PATTERN
- yubikit.oath.MASK_ALGO = 15
- yubikit.oath.MASK_TYPE = 240
- yubikit.oath.DEFAULT_PERIOD = 30
- yubikit.oath.DEFAULT_DIGITS = 6
- yubikit.oath.DEFAULT_IMF = 0
- yubikit.oath.CHALLENGE_LEN = 8
- yubikit.oath.HMAC_MINIMUM_KEY_SIZE = 14
- class yubikit.oath.HASH_ALGORITHM[source]
Bases:
enum.IntEnum
Enum where members are also (and must be) ints
- SHA1 = 1
- SHA256 = 2
- SHA512 = 3
- class yubikit.oath.OATH_TYPE[source]
Bases:
enum.IntEnum
Enum where members are also (and must be) ints
- HOTP = 16
- TOTP = 32
- yubikit.oath.PROP_REQUIRE_TOUCH = 2
- yubikit.oath.parse_b32_key(key)[source]
Parse Base32 encoded key.
- Parameters:
key (str) – The Base32 encoded key.
- class yubikit.oath.CredentialData[source]
An object holding OATH credential data.
- hash_algorithm: HASH_ALGORITHM
- class yubikit.oath.OathSession(connection, scp_key_params=None)[source]
A session with the OATH application.
- Parameters:
connection (yubikit.core.smartcard.SmartCardConnection)
scp_key_params (Optional[yubikit.core.smartcard.ScpKeyParams])
- protocol
- property version: yubikit.core.Version
The version of the OATH application.
- Return type:
- property device_id: str
The device ID.
A random static identifier that is re-generated on reset.
- Return type:
- property locked: bool
If True, the OATH application is currently locked via an access key.
- Return type:
- validate(key)[source]
Validate authentication with access key.
This unlocks the session for use.
- Parameters:
key (bytes) – The access key.
- Return type:
None
- set_key(key)[source]
Set an access key for authentication.
- Parameters:
key (bytes) – The access key.
- Return type:
None
- unset_key()[source]
Remove the access key.
This removes the need to authentication a session before using it.
- Return type:
None
- put_credential(credential_data, touch_required=False)[source]
Add an OATH credential.
- Parameters:
credential_data (CredentialData) – The credential data.
touch_required (bool) – The touch policy.
- Return type:
- delete_credential(credential_id)[source]
Delete an OATH credential.
- Parameters:
credential_id (bytes) – The id of the credential.
- Return type:
None
- calculate_all(timestamp=None)[source]
Calculate codes for all OATH credentials on the YubiKey.
This excludes credentials which require touch as well as HOTP credentials.
- Parameters:
timestamp (Optional[int]) – A timestamp used for the TOTP challenge.
- Return type:
Mapping[Credential, Optional[Code]]
- calculate_code(credential, timestamp=None)[source]
Calculate code for an OATH credential.
- Parameters:
credential (Credential) – The credential object.
timestamp (Optional[int]) – The timestamp.
- Return type: