From 0a54fa92e4749d6f791af7c04b5460b2536d3ba3 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Thu, 7 Apr 2022 00:03:00 +0200 Subject: [PATCH] Implement ApplicationIdentifier.manufacturer_name() --- openpgp-card/src/card_do/application_id.rs | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/openpgp-card/src/card_do/application_id.rs b/openpgp-card/src/card_do/application_id.rs index a5e6cd0..54fb05c 100644 --- a/openpgp-card/src/card_do/application_id.rs +++ b/openpgp-card/src/card_do/application_id.rs @@ -54,6 +54,40 @@ impl ApplicationIdentifier { self.serial } + /// Mapping of manufacturer id to a name, data from: + /// https://en.wikipedia.org/wiki/OpenPGP_card [2022-04-07] + pub fn manufacturer_name(&self) -> &'static str { + match self.manufacturer { + 0x0000 => "Testcard", + 0x0001 => "PPC Card Systems", + 0x0002 => "Prism Payment Technologies", + 0x0003 => "OpenFortress Digital signatures", + 0x0004 => "Wewid AB", + 0x0005 => "ZeitControl cardsystems GmbH", + 0x0006 => "Yubico AB", + 0x0007 => "OpenKMS", + 0x0008 => "LogoEmail", + 0x0009 => "Fidesmo AB", + 0x000A => "Dangerous Things", + 0x000B => "Feitian Technologies", + 0x002A => "Magrathea", + 0x0042 => "GnuPG e.V.", + 0x1337 => "Warsaw Hackerspace", + 0x2342 => "warpzone e.V.", + 0x4354 => "Confidential Technologies", + 0x5443 => "TIF-IT e.V.", + 0x63AF => "Trustica s.r.o", + 0xBA53 => "c-base e.V.", + 0xBD0E => "Paranoidlabs", + 0xF1D0 => "CanoKeys", + 0xF517 => "Free Software Initiative of Japan", + 0xF5EC => "F-Secure", + 0xFF00..=0xFFFE => "Range reserved for randomly assigned serial numbers.", + 0xFFFF => "Testcard", + _ => "Unknown", + } + } + /// This ident is constructed as the concatenation of manufacturer /// id, a colon, and the card serial (in hexadecimal representation, /// with uppercase hex digits).