fn new_pk_and_sig_der(curve_name: Nid) -> (Vec<u8>, Vec<u8>) {
    let group = EcGroup::from_curve_name(curve_name).expect("unable to create EC group");
    let ec_key = EcKey::generate(&group).expect("unable to generate EC key");
    let ecdsa_sig = EcdsaSig::sign(MESSAGE.as_ref(), &ec_key).expect("unable to sign");
    let pkey = PKey::from_ec_key(ec_key).expect("unable to create PKey");

    (
        pkey.public_key_to_der()
            .expect("unable to DER-encode public key"),
        ecdsa_sig.to_der().expect("unable to DER-encode signature"),
    )
}
// Genereates a new EC key pair, and computes an ECDSA signature on MESSAGE.
// Returns the generated public key and the signature, both DER-encoded.
Genereates a new EC key pair, and computes an ECDSA signature on MESSAGE.
Returns the generated public key and the signature, both DER-encoded.
Genereates a new EC key pair and computes an ECDSA signature on MESSAGE . Returns the generated public key and the signature both DER - encoded .
fn new_pk_and_sig_der(curve_name: Nid) -> (Vec<u8>, Vec<u8>) {
    let group = EcGroup::from_curve_name(curve_name).expect("unable to create EC group");
    let ec_key = EcKey::generate(&group).expect("unable to generate EC key");
    let ecdsa_sig = EcdsaSig::sign(MESSAGE.as_ref(), &ec_key).expect("unable to sign");
    let pkey = PKey::from_ec_key(ec_key).expect("unable to create PKey");
    (
        pkey.public_key_to_der()
            .expect("unable to DER-encode public key"),
        ecdsa_sig.to_der().expect("unable to DER-encode signature"),
    )
}
fn new_pk_and_sig_der ( curve_name : Nid ) -> ( Vec < u8 > , Vec < u8 > ) { let group = EcGroup :: from_curve_name ( curve_name ) . expect ( " " ) ; let ec_key = EcKey :: generate ( & group ) . expect ( " " ) ; let ecdsa_sig = EcdsaSig :: sign ( MESSAGE . as_ref ( ) , & ec_key ) . expect ( " " ) ; let pkey = PKey :: from_ec_key ( ec_key ) . expect ( " " ) ; ( pkey . public_key_to_der ( ) . expect ( " " ) , ecdsa_sig . to_der ( ) . expect ( " " ) , ) }
Genereates a new EC key pair, and computes an ECDSA signature on MESSAGE.
Genereates a new EC key pair and computes an ECDSA signature on MESSAGE .
curve_name
Nid
curve_name
Nid