This commit is contained in:
Heiko Schaefer 2022-05-01 21:41:28 +02:00
parent b668aebaba
commit 46d9a2dad9
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D

View file

@ -271,13 +271,11 @@ pub enum KeyType {
impl KeyType { impl KeyType {
/// Get C1/C2/C3/DA values for this KeyTypes, to use as Tag /// Get C1/C2/C3/DA values for this KeyTypes, to use as Tag
fn algorithm_tag(&self) -> u8 { fn algorithm_tag(&self) -> u8 {
use KeyType::*;
match self { match self {
Signing => 0xC1, Self::Signing => 0xC1,
Decryption => 0xC2, Self::Decryption => 0xC2,
Authentication => 0xC3, Self::Authentication => 0xC3,
Attestation => 0xDA, Self::Attestation => 0xDA,
} }
} }
@ -286,13 +284,11 @@ impl KeyType {
/// (NOTE: these Tags are only used for "PUT DO", but GETting /// (NOTE: these Tags are only used for "PUT DO", but GETting
/// fingerprint information from the card uses the combined Tag C5) /// fingerprint information from the card uses the combined Tag C5)
fn fingerprint_put_tag(&self) -> u8 { fn fingerprint_put_tag(&self) -> u8 {
use KeyType::*;
match self { match self {
Signing => 0xC7, Self::Signing => 0xC7,
Decryption => 0xC8, Self::Decryption => 0xC8,
Authentication => 0xC9, Self::Authentication => 0xC9,
Attestation => 0xDB, Self::Attestation => 0xDB,
} }
} }
@ -301,13 +297,11 @@ impl KeyType {
/// (NOTE: these Tags are only used for "PUT DO", but GETting /// (NOTE: these Tags are only used for "PUT DO", but GETting
/// timestamp information from the card uses the combined Tag CD) /// timestamp information from the card uses the combined Tag CD)
fn timestamp_put_tag(&self) -> u8 { fn timestamp_put_tag(&self) -> u8 {
use KeyType::*;
match self { match self {
Signing => 0xCE, Self::Signing => 0xCE,
Decryption => 0xCF, Self::Decryption => 0xCF,
Authentication => 0xD0, Self::Authentication => 0xD0,
Attestation => 0xDD, Self::Attestation => 0xDD,
} }
} }
} }