pub fn generate(mut bits: usize) -> OsshResult<Self> {
        if bits == 0 {
            bits = RSA_DEF_SIZE;
        }
        if !(RSA_MIN_SIZE..=RSA_MAX_SIZE).contains(&bits) {
            return Err(Error::from_kind(ErrorKind::InvalidKeySize));
        }
        Ok(RsaKeyPair {
            rsa: Rsa::generate(bits as u32)?,
            signhash: RsaSignature::SHA1,
        })
    }
/// Generate RSA key pair
///
/// The bits parameter should be within 1024 ~ 16384 bits or `0` to use default length (2048 bits).
Generate RSA key pair
The bits parameter should be within 1024 ~ 16384 bits or `0` to use default length (2048 bits).
Generate RSA key pair The bits parameter should be within 1024 ~ 16384 bits or ` 0 ` to use default length ( 2048 bits ) .
pub fn generate(mut bits: usize) -> OsshResult<Self> {
        if bits == 0 {
            bits = RSA_DEF_SIZE;
        }
        if !(RSA_MIN_SIZE..=RSA_MAX_SIZE).contains(&bits) {
            return Err(Error::from_kind(ErrorKind::InvalidKeySize));
        }
        Ok(RsaKeyPair {
            rsa: Rsa::generate(bits as u32)?,
            signhash: RsaSignature::SHA1,
        })
    }
pub fn generate ( mut bits : usize ) -> OsshResult < Self > { if bits == 0 { bits = RSA_DEF_SIZE ; } if ! ( RSA_MIN_SIZE ..= RSA_MAX_SIZE ) . contains ( & bits ) { return Err ( Error :: from_kind ( ErrorKind :: InvalidKeySize ) ) ; } Ok ( RsaKeyPair { rsa : Rsa :: generate ( bits as u32 ) ? , signhash : RsaSignature :: SHA1 , } ) }
Generate RSA key pair
The bits parameter should be within 1024 ~ 16384 bits or `0` to use default length (2048 bits).
Generate RSA key pair The bits parameter should be within 1024 ~ 16384 bits or ` 0 ` to use default length ( 2048 bits ) .
bits
usize
bits
usize