Hi Bala, > Can you please help to understand the use of the callback function that can be set during key generation ? AFAI remember, nothing special except provide a way to show work is still running (using a progress bar for example) and a mechanism to cancel the generation if it lasts too long. "If the callback returns 0 then the key generation operation is aborted and an error occurs. This might occur during a time consuming operation where a user clicks on a "cancel" button". (from https://www.openssl.org/docs/man3.0/man3/EVP_PKEY_CTX_set_cb.html) > Is EVP_PKEY_CTX_set_cb API replacement for the deprecated BN_GENCB_set_old No, BN_GENCB_set[...] is a similar mechanism but for Big Number / Prime (not *Key*) generation. (https://www.openssl.org/docs/man3.0/man3/BN_GENCB_set_old.html) Hope it helps, Regards, Michel.