pub fn generate(mut bits: usize) -> OsshResult<Self> {
        if bits == 0 {
            bits = ECDSA_DEF_SIZE;
        }
        let curve = match bits {
            256 => EcCurve::Nistp256,
            384 => EcCurve::Nistp384,
            521 => EcCurve::Nistp521,
            _ => return Err(Error::from_kind(ErrorKind::InvalidKeySize)),
        };
        let group: EcGroup = curve.try_into()?;

        Ok(EcDsaKeyPair {
            key: EcKey::generate(&group)?,
            curve,
        })
    }
/// Generate EcDSA key pair
///
/// The bits parameter should be 256, 284, 521 bits or `0` to use default length (256 bits).
/// Different key length is corresponding to different curve.
Generate EcDSA key pair
The bits parameter should be 256, 284, 521 bits or `0` to use default length (256 bits).
Different key length is corresponding to different curve.
Generate EcDSA key pair The bits parameter should be 256 284 521 bits or ` 0 ` to use default length ( 256 bits ) . Different key length is corresponding to different curve .
pub fn generate(mut bits: usize) -> OsshResult<Self> {
        if bits == 0 {
            bits = ECDSA_DEF_SIZE;
        }
        let curve = match bits {
            256 => EcCurve::Nistp256,
            384 => EcCurve::Nistp384,
            521 => EcCurve::Nistp521,
            _ => return Err(Error::from_kind(ErrorKind::InvalidKeySize)),
        };
        let group: EcGroup = curve.try_into()?;
        Ok(EcDsaKeyPair {
            key: EcKey::generate(&group)?,
            curve,
        })
    }
pub fn generate ( mut bits : usize ) -> OsshResult < Self > { if bits == 0 { bits = ECDSA_DEF_SIZE ; } let curve = match bits { 256 => EcCurve :: Nistp256 , 384 => EcCurve :: Nistp384 , 521 => EcCurve :: Nistp521 , _ => return Err ( Error :: from_kind ( ErrorKind :: InvalidKeySize ) ) , } ; let group : EcGroup = curve . try_into ( ) ? ; Ok ( EcDsaKeyPair { key : EcKey :: generate ( & group ) ? , curve , } ) }
Generate EcDSA key pair
The bits parameter should be 256, 284, 521 bits or `0` to use default length (256 bits).
Generate EcDSA key pair The bits parameter should be 256 284 521 bits or ` 0 ` to use default length ( 256 bits ) .
bits
usize
bits
usize