<div dir="ltr">Hi All,<div><br></div><div>While writing the engine implementation for private key encryption and decryption, I need to get the private key from external source. </div><div><div>ENGINE_set_load_privkey_function(e, load_tpm_private_key)<br></div><div>Above API is success.<br></div><div><br></div><div></div></div><div></div><div>RSA structure is as below.</div><div>RSA_METHOD my_rsa_struct =<br>{<br>   "MY RSA method",<br>   NULL,<br>   NULL,<br>   MyRSAPrivEnc,<br>   MyRSAPrivDec,<br>   NULL, <br>   NULL,<br>   NULL, <br>   NULL,<br>   0, <br>   NULL,<br>   NULL,<br>   NULL,<br>   NULL<br>};<br></div><div><br></div><div>However, the routine 

load_tpm_private_key  does not get invoked during private key encryption and decryption.<br></div><div>Private key encryption and decryption gets routed to the above overloaded routines namely "

MyRSAPrivEnc

" and "

MyRSAPrivDec". But 

 load_tpm_private_key never gets invoked. </div><div><br></div><div>Is there a flag  to force the same ? I have tried it using openssl 1.0.2 version. All other engine calls work as expected, but not this one. </div><div><br></div><div>I have also tried to debug in ENGINE_load_private_key in eng_pkey.c file. I dont see this function getting invoked. In this function, the private key callback set above gets invoked.</div><div> </div><div>Please suggest if I am missing something here.</div><div><br></div><div>Thanks</div><div>Mahendra</div></div>