We need a helper function in GPGM to extract the PGP ECC parameters from a key. These are required by Kleopatra to be passed to the KEYTOCARD command.
We need something similar to this:
char * ecdh_param_str_from_pk (PKT_public_key *pk) { const unsigned char *s; unsigned int n; if (!pk || pk->pubkey_algo != PUBKEY_ALGO_ECDH || !gcry_mpi_get_flag (pk->pkey[2], GCRYMPI_FLAG_OPAQUE) || !(s = gcry_mpi_get_opaque (pk->pkey[2], &n)) || !n) { gpg_err_set_errno (EINVAL); return NULL; /* Invalid parameter */ } n = (n+7)/8; return bin2hex (s, n, NULL); }