diff --git a/src/pss.rs b/src/pss.rs index ebb245fd..7b45c7ce 100644 --- a/src/pss.rs +++ b/src/pss.rs @@ -38,6 +38,9 @@ use crate::key::{PrivateKey, PublicKey}; use crate::padding::SignatureScheme; use crate::{RsaPrivateKey, RsaPublicKey}; +#[cfg(feature = "getrandom")] +use {rand_core::OsRng, signature::Signer}; + /// Digital signatures using PSS padding. pub struct Pss { /// Create blinded signatures. @@ -755,6 +758,16 @@ where } } +#[cfg(feature = "getrandom")] +impl Signer for SigningKey +where + D: Digest + FixedOutputReset, +{ + fn try_sign(&self, msg: &[u8]) -> signature::Result { + self.try_sign_with_rng(&mut OsRng, msg) + } +} + impl RandomizedSigner for SigningKey where D: Digest + FixedOutputReset,