Open tony-iqlusion opened 3 years ago
I am curious about whether yubikey.rs
would support managing the oauth TOTP credentials on a Yubikey (ykman oath
).
Do the various _object
methods cover this behavior or the low-level building blocks?
This library is a translation of yubico-piv-tool
, and as far as I know that has no support for obtaining OATH-TOTP codes from the OTP applet.
It's something we'd be happy to add. There's some very basic support for interacting with the OTP applet for obtaining version information, but that's it.
I believe there was some support for this in earlier versions of the yubikey
crate which had a completely different codebase. If so, perhaps some of that work can be extracted and re-integrated.
I went ahead and gisted the source code of the earlier yubikey
crate which has OTP support. Here is the relevant function:
https://gist.github.com/tarcieri/3dfb1628a48d39651f313b76d61d5cb2#file-yubikey-rs-L317-L325
The code is written using the (now defunct) libusb
crate which is quite a bit different from how this crate works, as we use a portable PC/SC abstraction library. So it'd need to be rewritten to use that instead.
@tony-iqlusion wow, thank you for the detailed guidance! I'll note that gist and explore as I have freer time.
This is a tracking issue for all functionality currently gated under the
untested
feature.Please leave a comment here if you were able to use the functionality successfully and/or are interested in writing tests.
Ccc::set
: set Cardholder Capability Container (CCC) IDCertificate::delete
: delete X.509 certificateChuId::set
: set Cardholder Unique Identifier (CHUID)Metadata
: metadata stored in a YubiKeyMetadata::delete
: delete metadataMetadata::set_item
: set metadata itemMetadata::write
: write metadataMgmKey
: management keyMgmKey::get_derived
: get derived management key (MGM) for a provided PINMgmKey::get_protected
: get protected management key (MGM)MgmKey::set_default
: resets the management key for the given YubiKey to the default valueMgmKey::set_protected
: configure a PIN-protected management keyMsContainer::*
: MS Container Map recordsMsRoots::*
: PKCS#7-formatted certificate store for enterprise trust rootsRsaKeyData::*
: data that makes up an RSA keyYubiKey
: YubiKey deviceYubiKey::block_puk
: permanently prevent the PIN from becoming unblocked by blocking PUKYubiKey::change_pin
: change the Personal Identification Number (PIN)YubiKey::change_puk
: change PIN Unblocking Key (PUK)YubiKey::deauthenticate
: deauthenticate from a YubiKeyYubiKey::get_auth_challenge
: get an authentication challengeYubiKey::fetch_object
: fetch an object with a given ID from the YubiKeyYubiKey::reconnect
: reconnect to a YubiKeyYubiKey::reset_device
: reset YubiKey to factory stateYubiKey::save_object
: save an object to the given object ID of a YubiKeyYubiKey::set_pin_last_changed
: set pin last changedYubiKey::set_pin_retries
: set the number of PIN retriesYubiKey::unblock_pin
: unblock PIN using PUKYubiKey::verify_auth_response
: verify an authentication responsepiv
: Personal Identity Verification (PIV) cryptographic keyspiv::attest
: generate an attestation certificate for a stored keypiv::decrypt_data
: decrypt data using a PIV key (see also #258)piv::import_ecc_key
: imports a private ECC encryption or signing key into the YubiKeypiv::import_rsa_key
: imports a private RSA encryption or signing key into the YubiKey