pub fn generate(curve: EcxCurve) -> Result<EcxKeyPair, JoseError> {
        (|| -> anyhow::Result<EcxKeyPair> {
            let private_key = match curve {
                EcxCurve::X25519 => PKey::generate_x25519()?,
                EcxCurve::X448 => PKey::generate_x448()?,
            };

            Ok(EcxKeyPair {
                curve,
                private_key,
                algorithm: None,
                key_id: None,
            })
        })()
        .map_err(|err| JoseError::InvalidKeyFormat(err))
    }
/// Generate a Montgomery curve key pair
///
/// # Arguments
/// * `curve` - Montgomery curve curve algorithm
Generate a Montgomery curve key pair
Generate a Montgomery curve key pair
pub fn generate(curve: EcxCurve) -> Result<EcxKeyPair, JoseError> {
        (|| -> anyhow::Result<EcxKeyPair> {
            let private_key = match curve {
                EcxCurve::X25519 => PKey::generate_x25519()?,
                EcxCurve::X448 => PKey::generate_x448()?,
            };
            Ok(EcxKeyPair {
                curve,
                private_key,
                algorithm: None,
                key_id: None,
            })
        })()
        .map_err(|err| JoseError::InvalidKeyFormat(err))
    }
pub fn generate ( curve : EcxCurve ) -> Result < EcxKeyPair , JoseError > { ( | | -> anyhow :: Result < EcxKeyPair > { let private_key = match curve { EcxCurve :: X25519 => PKey :: generate_x25519 ( ) ? , EcxCurve :: X448 => PKey :: generate_x448 ( ) ? , } ; Ok ( EcxKeyPair { curve , private_key , algorithm : None , key_id : None , } ) } ) ( ) . map_err ( | err | JoseError :: InvalidKeyFormat ( err ) ) }
Generate a Montgomery curve key pair
Generate a Montgomery curve key pair
curve
EcxCurve
curve
EcxCurve