feat: v1.5.8, opt piv-meta

This commit is contained in:
2023-05-17 00:53:17 +08:00
parent 0ad8c12c38
commit 9fb0da7d33
4 changed files with 8 additions and 3 deletions

View File

@@ -4,6 +4,10 @@ use rust_util::XResult;
use yubikey::piv::RetiredSlotId;
use yubikey::piv::SlotId;
pub fn slot_equals(slot_id: &SlotId, slot: &str) -> bool {
get_slot_id(slot).map(|sid| &sid == slot_id).unwrap_or(false)
}
pub fn get_slot_id(slot: &str) -> XResult<SlotId> {
Ok(match slot {
"9a" => SlotId::Authentication,