diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2023-05-12 18:53:49 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2023-05-22 12:00:11 +0200 |
commit | d1fb7c0582058ccbe262b6650ca43f627ed8d628 (patch) | |
tree | b9901e5542a8dc85adf389100ab31c07b5db5d8b /openpgp/src/types | |
parent | 995a7cff7fa0cd3273d8dad8080f6b50de79eaa9 (diff) |
openpgp: Formalize reporting of supported algorithms.
Diffstat (limited to 'openpgp/src/types')
-rw-r--r-- | openpgp/src/types/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
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) } } |