<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Yeah,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
that is what i have figured it out and written it in my previous message:] but big thx for help.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
BR</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Piotr Lobacz</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Od:</b> Selva Nair <selva.nair@gmail.com><br>
<b>Wysłane:</b> środa, 26 maja 2021 15:52<br>
<b>Do:</b> Piotr Lobacz <piotr.lobacz@softgent.com><br>
<b>DW:</b> openssl-users@openssl.org <openssl-users@openssl.org><br>
<b>Temat:</b> Re: dynamic engine load</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi,<br>
<br>
On Wed, May 26, 2021 at 9:25 AM Piotr Lobacz <piotr.lobacz@softgent.com> wrote:<br>
><br>
> Hi all,<br>
> I am trying to write a function which will load dynamic engine for pkcs11. What i intendt to do is not to use engine id pkcs11 but dynamic. The problem is that i get an error for ENGINE_ctrl_cmd_string with MODULE_PATH parameter. My function currently looks
 like this:<br>
><br>
>         public void Initialize()<br>
>         {<br>
>             if (null == engine)<br>
>             {<br>
>                 engine = SafeNativeMethods.ENGINE_by_id("dynamic");<br>
>                 if (engine.IsInvalid)<br>
>                 {<br>
>                     throw new InvalidOperationException($"Unable to load dynamic engine");<br>
>                 }<br>
><br>
>                 if (!File.Exists(EnginePath))<br>
>                 {<br>
>                     throw new InvalidOperationException($"Unable to find engine library path");<br>
>                 }<br>
><br>
>                 if (1 != SafeNativeMethods.ENGINE_ctrl_cmd_string(engine, "SO_PATH", EnginePath, 0))<br>
>                 {<br>
>                     throw new InvalidOperationException("dynamic: setting so_path <= '{EnginePath}'");<br>
>                 }<br>
<br>
At this point you should do the "LOAD" control to get the dynamic<br>
engine shell replaced by pkcs11. Then set the ID and the MODULE_PATH.<br>
<br>
So its dynamic --> set SO_PATH --> LOAD and then set all parameters of<br>
the engine that SO_PATH implements.<br>
<br>
Selva<br>
<br>
<br>
Selva<br>
</div>
</span></font></div>
<a href="https://www.softgent.com" target="_blank"><img width="150" height="50" src="https://softgent.com/wp-content/uploads/2020/01/Zasob-14.png"></a>
<p style="color: gray; display: block; font-size: 9px; text-transform: uppercase; margin: 0; margin-top: 10px;">
<b>Softgent Sp. z o.o.</b>, Budowlanych 31d, 80-298 Gdansk, POLAND</p>
<p style="color: gray; display: block; font-size: 9px; text-transform: uppercase; margin: 0;">
KRS: 0000674406, NIP: 9581679801, REGON: 367090912</p>
<p style="color: gray; display: block; font-size: 9px; text-transform: uppercase; margin: 0;">
www.softgent.com</p>
<p style="color: gray; display: block; font-size: 9px; text-transform: uppercase; margin: 0; margin-top: 10px;">
Sąd Rejonowy Gdańsk-Północ w Gdańsku, VII Wydział Gospodarczy Krajowego Rejestru Sądowego</p>
<p style="color: gray; display: block; font-size: 9px; text-transform: uppercase; margin: 0;">
KRS 0000674406, Kapitał zakładowy: 25 000,00 zł wpłacony w całości.</p>
</body>
</html>