summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto/backend/cng/asymmetric.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/crypto/backend/cng/asymmetric.rs')
-rw-r--r--openpgp/src/crypto/backend/cng/asymmetric.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/openpgp/src/crypto/backend/cng/asymmetric.rs b/openpgp/src/crypto/backend/cng/asymmetric.rs
index 38eb1905..6ca15bb1 100644
--- a/openpgp/src/crypto/backend/cng/asymmetric.rs
+++ b/openpgp/src/crypto/backend/cng/asymmetric.rs
@@ -27,8 +27,10 @@ impl Asymmetric for super::Backend {
use PublicKeyAlgorithm::*;
#[allow(deprecated)]
match algo {
+ X25519 | Ed25519 |
RSAEncryptSign | RSAEncrypt | RSASign | DSA | ECDH | ECDSA | EdDSA
=> true,
+ X448 | Ed448 |
ElGamalEncrypt | ElGamalEncryptSign | Private(_) | Unknown(_)
=> false,
}
@@ -498,12 +500,13 @@ impl<P: key::KeyParts, R: key::KeyRole> Key<P, R> {
ECDH => crate::crypto::ecdh::encrypt(self.parts_as_public(), data),
- RSASign | DSA | ECDSA | EdDSA =>
+ RSASign | DSA | ECDSA | EdDSA | Ed25519 | Ed448 =>
Err(Error::InvalidOperation(
format!("{} is not an encryption algorithm", self.pk_algo())
).into()),
ElGamalEncrypt | ElGamalEncryptSign |
+ X25519 | X448 |
Private(_) | Unknown(_) =>
Err(Error::UnsupportedPublicKeyAlgorithm(self.pk_algo()).into()),
}