From d1fb7c0582058ccbe262b6650ca43f627ed8d628 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Fri, 12 May 2023 18:53:49 +0200 Subject: openpgp: Formalize reporting of supported algorithms. --- openpgp/src/types/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'openpgp/src/types/mod.rs') diff --git a/openpgp/src/types/mod.rs b/openpgp/src/types/mod.rs index 64fd174e..88fe1505 100644 --- a/openpgp/src/types/mod.rs +++ b/openpgp/src/types/mod.rs @@ -207,7 +207,8 @@ impl PublicKeyAlgorithm { /// assert!(!PublicKeyAlgorithm::Private(101).is_supported()); /// ``` pub fn is_supported(&self) -> bool { - self.is_supported_by_backend() + use crate::crypto::backend::{Backend, interface::Asymmetric}; + Backend::supports_algo(*self) } /// Returns an iterator over all valid variants. @@ -605,7 +606,8 @@ impl Curve { /// assert!(!Curve::Unknown(Box::new([0x2B, 0x11])).is_supported()); /// ``` pub fn is_supported(&self) -> bool { - self.is_supported_by_backend() + use crate::crypto::backend::{Backend, interface::Asymmetric}; + Backend::supports_curve(self) } } -- cgit v1.2.3