openpgp-card: rename AlgorithmInformation::filter_by_keytype -> for_keytype

This commit is contained in:
Heiko Schaefer 2023-08-29 17:16:52 +02:00
parent f7f7a1dd3c
commit da776bc4cf
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D
2 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2021-2023 Heiko Schaefer <heiko@schaefer.name>
// SPDX-License-Identifier: MIT OR Apache-2.0
//! 4.4.3.11 Algorithm Information
//! Algorithm Information [Spec section 4.4.3.11]
use std::convert::TryFrom;
use std::fmt;
@ -15,7 +15,7 @@ use crate::card_do::{algo_attrs, complete};
use crate::KeyType;
impl AlgorithmInformation {
pub fn filter_by_keytype(&self, kt: KeyType) -> Vec<&AlgorithmAttributes> {
pub fn for_keytype(&self, kt: KeyType) -> Vec<&AlgorithmAttributes> {
self.0
.iter()
.filter(|(k, _)| *k == kt)

View file

@ -292,7 +292,7 @@ fn card_algo_rsa(
// Find suitable algorithm parameters (from card's list of algorithms).
// Get Algos for this keytype
let keytype_algos: Vec<_> = algo_info.filter_by_keytype(key_type);
let keytype_algos: Vec<_> = algo_info.for_keytype(key_type);
// Get RSA algo attributes
let rsa_algos: Vec<_> = keytype_algos
.iter()
@ -334,7 +334,7 @@ fn check_card_algo_ecc(
// Find suitable algorithm parameters (from card's list of algorithms).
// Get Algos for this keytype
let keytype_algos: Vec<_> = algo_info.filter_by_keytype(key_type);
let keytype_algos: Vec<_> = algo_info.for_keytype(key_type);
// Get attributes
let ecc_algos: Vec<_> = keytype_algos