diff --git a/openpgp-card-sequoia/src/card.rs b/openpgp-card-sequoia/src/card.rs index 3b2879f..078a458 100644 --- a/openpgp-card-sequoia/src/card.rs +++ b/openpgp-card-sequoia/src/card.rs @@ -285,6 +285,11 @@ impl<'a> Open<'a> { self.opt.algorithm_information() } + /// Get "Attestation Certificate (Yubico)" + pub fn attestation_certificate(&mut self) -> Result, Error> { + self.opt.attestation_certificate() + } + /// Firmware Version, YubiKey specific (?) pub fn firmware_version(&mut self) -> Result, Error> { self.opt.firmware_version() diff --git a/openpgp-card/src/apdu/commands.rs b/openpgp-card/src/apdu/commands.rs index 1b48d8e..e4b9454 100644 --- a/openpgp-card/src/apdu/commands.rs +++ b/openpgp-card/src/apdu/commands.rs @@ -67,6 +67,11 @@ pub(crate) fn algo_info() -> Command { get_data(Tags::AlgorithmInformation) } +/// GET DO "Attestation Certificate (Yubico)" +pub(crate) fn attestation_certificate() -> Command { + get_data(Tags::AttestationCertificate) +} + /// GET Firmware Version (yubikey specific?) pub(crate) fn firmware_version() -> Command { Command::new(0x00, 0xF1, 0x00, 0x00, vec![]) diff --git a/openpgp-card/src/openpgp.rs b/openpgp-card/src/openpgp.rs index 973c7fc..f0771b0 100644 --- a/openpgp-card/src/openpgp.rs +++ b/openpgp-card/src/openpgp.rs @@ -160,6 +160,15 @@ impl<'a> OpenPgpTransaction<'a> { Ok(Some(ai)) } + /// Get "Attestation Certificate (Yubico)" + pub fn attestation_certificate(&mut self) -> Result, Error> { + log::info!("OpenPgpTransaction: attestation_certificate"); + + let resp = apdu::send_command(self.tx(), commands::attestation_certificate(), true)?; + + Ok(resp.data()?.into()) + } + /// Firmware Version (YubiKey specific (?)) pub fn firmware_version(&mut self) -> Result, Error> { log::info!("OpenPgpTransaction: firmware_version");