title: Link to ENGINE_load_private_key in OpenSSL function
body: <p>I am developing a sample OpenSSL Engine for my application.</p>
  
  <pre><code>#include &lt;openssl/engine.h&gt;
  
  static const char *engine_id = "sample";
  static const char *engine_name = "developed by Devang";
  
  static int engine_init(ENGINE *e);  
  static EVP_PKEY *load_key(ENGINE *e, const char *id, UI_METHOD *ui, void *cb);
  
  int bind_helper(ENGINE*e, const char *id)  {
        if(!ENGINE_set_id(e, engine_id) ||
           !ENGINE_set_init_function(e, engine_init) ||
           !ENGINE_set_load_privkey_function(e, load_key))
           return 0;
  
    return 1;  
  
  }
  
  IMPLEMENT_DYNAMIC_CHECK_FN(); IMPLEMENT_DYANMIC_BIND_FN(bind_helper);
  
  static int engine_init(ENGINE *e) 
  {
      printf("In engine_init \n"); 
  } 
  static EVP_PKEY *load_key(ENGINE *e, const char *id, UI_METHOD *ui, void *cb) {    
      printf(" In load_key function\n"); 
  }
  </code></pre>
  
  <p>I built this openssl engine (sample.so) and shared lib I put into 
  /usr/lib/x86_64-linu-gnu/openssl-1.0.0/engines/</p>
  
  <p>I created a sample application
  sampleTest.c</p>
  
  <pre><code>#include &lt;openssl/engine.h&gt;
  
  int main(void)
  {
      ENGINE_load_dynamic();
      ENGINE *en = ENGINE_by_id("sample");
      ENGINE_init(en);
      ENGINE_load_private_key(en, NULL, UI_OpenSSL(), NULL);
  }
  </code></pre>
  
  <p>I run this sample application,
  Output:</p>
  
  <blockquote>
    <p>In engine_init</p>
  </blockquote>
  
  <p>Why load_key function is not called ?
  Can anyone help me link to load_key function from my application ?</p>