openpgp-card-sequoia: move all uif_* getters into uif()

This commit is contained in:
Heiko Schaefer 2023-09-03 22:38:19 +02:00
parent d55980cef6
commit 736199a8de
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D

View file

@ -539,20 +539,17 @@ impl<'a> Card<Transaction<'a>> {
self.state.ard.key_information() self.state.ard.key_information()
} }
pub fn uif_signing(&self) -> Result<Option<UserInteractionFlag>, Error> { pub fn uif(&self, key_type: KeyType) -> Result<Option<UserInteractionFlag>, Error> {
self.state.ard.uif_pso_cds() match key_type {
} KeyType::Signing => self.state.ard.uif_pso_cds(),
KeyType::Decryption => self.state.ard.uif_pso_dec(),
pub fn uif_decryption(&self) -> Result<Option<UserInteractionFlag>, Error> { KeyType::Authentication => self.state.ard.uif_pso_aut(),
self.state.ard.uif_pso_dec() KeyType::Attestation => self.state.ard.uif_attestation(),
} _ => Err(Error::UnsupportedFeature(format!(
"Can't get UIF for key_type {:?}",
pub fn uif_authentication(&self) -> Result<Option<UserInteractionFlag>, Error> { key_type,
self.state.ard.uif_pso_aut() ))),
} }
pub fn uif_attestation(&self) -> Result<Option<UserInteractionFlag>, Error> {
self.state.ard.uif_attestation()
} }
// --- optional private DOs (0101 - 0104) --- // --- optional private DOs (0101 - 0104) ---