Unverified Commit 32a6f2b7 authored by Huw Jones's avatar Huw Jones
Browse files

pkey_ctx: add set dsa paramgen bits

parent 01651ddc
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -447,6 +447,22 @@ impl<T> PkeyCtxRef<T> {
        Ok(())
    }

    /// Sets the DSA paramgen bits.
    ///
    /// This is only useful for DSA keys.
    #[corresponds(EVP_PKEY_CTX_set_dsa_paramgen_bits)]
    #[inline]
    pub fn set_dsa_paramgen_bits(&mut self, bits: u32) -> Result<(), ErrorStack> {
        unsafe {
            cvt(ffi::EVP_PKEY_CTX_set_dsa_paramgen_bits(
                self.as_ptr(),
                bits as i32,
            ))?;
        }

        Ok(())
    }

    /// Returns the RSA padding mode in use.
    ///
    /// This is only useful for RSA keys.