diff --git a/openssl/src/crypto/rsa.rs b/openssl/src/crypto/rsa.rs index feb66a6f..3ba063cd 100644 --- a/openssl/src/crypto/rsa.rs +++ b/openssl/src/crypto/rsa.rs @@ -163,6 +163,7 @@ impl RSA { } pub fn sign(&self, hash: hash::Type, message: &[u8]) -> Result, ErrorStack> { + assert!(self.d().is_some(), "private components missing"); let k_len = self.size().expect("RSA missing an n"); let mut sig = vec![0; k_len as usize]; let mut sig_len = k_len;