<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I haven’t done exactly what you are trying, but something similar.<div class=""><br class=""></div><div class=""> See EVP_PKEY_set_params:<div class=""><br class=""></div><div class=""><a href="https://www.openssl.org/docs/man3.0/man3/EVP_PKEY_set_params.html" class="">https://www.openssl.org/docs/man3.0/man3/EVP_PKEY_set_params.html</a></div><div class=""><br class=""></div><div class="">The specific parm to set the group could be set like this:</div><div class=""><br class=""></div><div class=""><div class=""> OSSL_PARAM_BLD_push_utf8_string(param_bld, "group",                      </div><div class="">                                            curve, 0;</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Please note that that I have not tested the above code as my code uses key-from-data. But I think it should work.</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 24, 2022, at 2:31 PM, Martin via openssl-users <<a href="mailto:openssl-users@openssl.org" class="">openssl-users@openssl.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9.5pt; font-family: "Cascadia Mono";" class="">Hi,<o:p class=""></o:p></span></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9.5pt; font-family: "Cascadia Mono";" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9.5pt; font-family: "Cascadia Mono";" class="">How can I set a GROUP to an existing EC type EVP_PKEY in OpenSSL 3?<o:p class=""></o:p></span></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9.5pt; font-family: "Cascadia Mono";" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9.5pt; font-family: "Cascadia Mono";" class="">In 1.0.2 I was using this code having the EC_KEY:<o:p class=""></o:p></span></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9.5pt; font-family: "Cascadia Mono";" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9.5pt; font-family: "Cascadia Mono";" class="">EC_KEY_set_group(eckey, EC_GROUP_new_by_curve_name(nid));<o:p class=""></o:p></span></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9.5pt; font-family: "Cascadia Mono";" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9.5pt; font-family: "Cascadia Mono";" class="">In OpenSSL 3 still EC_GROUP_new_by_curve_name(nid) can be used, but I don’t know how to go from that to set it on the existing key.<o:p class=""></o:p></span></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9.5pt; font-family: "Cascadia Mono";" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9.5pt; font-family: "Cascadia Mono";" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9.5pt; font-family: "Cascadia Mono";" class="">Thanks,<o:p class=""></o:p></span></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9.5pt; font-family: "Cascadia Mono";" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9.5pt; font-family: "Cascadia Mono";" class="">Martin</span></div></div></div></blockquote></div><br class=""></div></div></body></html>