<div dir="ltr">If you are using RSA, maybe it should be useful to look at some RSA implementations, such as engines/e_devcrypto.c</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 6, 2020 at 7:23 PM Pedro Lopes <<a href="mailto:pedroterrosolopes@gmail.com">pedroterrosolopes@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<br><br>I'd like that my callback is called when a sign/verify is being requested by<br>*EVP_DigestSignFinal()* function.<br>I've tried add a EVP_PKEY_METHOD to app_methods stack, that works good<br>however doesnt fit on my solution.<br><br>I noticed that creating an engine and set pkey methods there, it could solve<br>it.<br>I looked at gost engine to have in mind what I should do.<br>So, in engine I call *ENGINE_set_pkey_meths()*, so far so good.<br><br>The issue occurs when I try to assign a RSA key. I call<br>*EVP_PKEY_assign(*outKey, NID_sha1WithRSAEncryption, key);*. The error<br>returned is *pkey_set_type:unsupported algorithm*.<br><br>Most probably I'm missing something.<br><br>If *EVP_PKEY_assign()*worked I will call *EVP_DigestSignInit(ctx, NULL,<br>sha1(), engine, pkey)*.<br><br>Thanks in advance.  <br></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">SY, Dmitry Belyavsky</div>