Adds support for metadata command (#371)

On firmware 5.4.3, yubikey introduced a metadata command. This returns
the policy attached to as slot as well as the public key of the pair in
the slot.

https://docs.yubico.com/yesdk/users-manual/application-piv/apdu/metadata.html
This commit is contained in:
Arthur Gautier
2022-11-12 19:12:10 +00:00
committed by GitHub
parent 7866d8d53e
commit 87ed7b2338
4 changed files with 483 additions and 104 deletions
+5
View File
@@ -195,6 +195,9 @@ pub enum Ins {
/// Get device serial
GetSerial,
/// Get slot metadata
GetMetadata,
/// Other/unrecognized instruction codes
Other(u8),
}
@@ -219,6 +222,7 @@ impl Ins {
Ins::SetPinRetries => 0xfa,
Ins::Attest => 0xf9,
Ins::GetSerial => 0xf8,
Ins::GetMetadata => 0xf7,
Ins::Other(code) => code,
}
}
@@ -243,6 +247,7 @@ impl From<u8> for Ins {
0xfa => Ins::SetPinRetries,
0xf9 => Ins::Attest,
0xf8 => Ins::GetSerial,
0xf7 => Ins::GetMetadata,
code => Ins::Other(code),
}
}