<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Форум Рутокен &mdash; Техническая поддержка разработчиков]]></title>
		<link>https://forum.rutoken.ru/</link>
		<atom:link href="https://forum.rutoken.ru/feed/rss/forum/25/" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние темы раздела «Форум Рутокен».]]></description>
		<lastBuildDate>Wed, 25 Jun 2025 07:05:55 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Установка rutoken launcher в linux через wine]]></title>
			<link>https://forum.rutoken.ru/topic/5323/new/posts/</link>
			<description><![CDATA[<p><strong>Всем доброго дня!</strong></p><p>От заказчика на работе поступил запрос на поддержку rutoken лаунчера для windows (<a href="https://www.rutoken.ru/support/download/windows/">https://www.rutoken.ru/support/download/windows/</a>) в операционной системе на базе Linux. <br />Однако после успешной отработки команды <strong>wine rtDrivers.exe</strong> установка завершается с ошибками.</p><p><strong>Источник установочного файла:</strong><br /><span class="postimg"><a class="fancybox fancybox.image" rel="group" href="https://forum.rutoken.ru/uploads/images/2025/06/c83fd93394b2ab8f77304be2615574bb.png"><img class="fb_img" src="https://forum.rutoken.ru/uploads/previews/2025/06/c83fd93394b2ab8f77304be2615574bb.png" alt="" /></a></span></p><br /><p><strong>Окно установки:</strong><br /><span class="postimg"><a class="fancybox fancybox.image" rel="group" href="https://forum.rutoken.ru/uploads/images/2025/06/e9eb4725984be28702ab554f5118b598.png"><img class="fb_img" src="https://forum.rutoken.ru/uploads/previews/2025/06/e9eb4725984be28702ab554f5118b598.png" alt="" /></a></span> </p><br /><p><strong>Командная строка:</strong><br /></p><div class="codebox"><pre><code>0024:fixme:heap:RtlSetHeapInformation HEAP_INFORMATION_CLASS 1 not implemented!
0024:fixme:advapi:DecryptFileW (L&quot;C:\\users\\vladimir\\AppData\\Local\\Temp\\{6DD12DDD-8E9F-4E2B-B9A5-D255471EB204}\\&quot;, 00000000): stub
012c:fixme:heap:RtlSetHeapInformation HEAP_INFORMATION_CLASS 1 not implemented!
012c:fixme:advapi:DecryptFileW (L&quot;C:\\users\\vladimir\\AppData\\Local\\Temp\\{27279A62-D759-4E89-9BCD-5AB0BFCEA72E}\\&quot;, 00000000): stub
012c:fixme:advapi:DecryptFileW (L&quot;C:\\users\\vladimir\\AppData\\Local\\Temp\\{27279A62-D759-4E89-9BCD-5AB0BFCEA72E}\\&quot;, 00000000): stub
012c:fixme:exec:SHELL_execute flags ignored: 0x00000100
0148:fixme:heap:RtlSetHeapInformation HEAP_INFORMATION_CLASS 1 not implemented!
0148:fixme:ole:CoInitializeSecurity 005BF608, -1, 00000000, 00000000, 6, 2, 00000000, 12288, 00000000 stub
0148:fixme:wuapi:automatic_updates_Pause 
0148:fixme:sfc:SRSetRestorePointW 005BF4D0 005BF6E0
0154:fixme:advapi:DecryptFileW (L&quot;C:\\ProgramData\\Package Cache\\{9704B6E4-5E0F-4682-8E7B-8F50C3D3A9C3}v4.21.00.0000\\rtDrivers.x64.msi&quot;, 00000000): stub
0148:fixme:file:NtLockFile I/O completion on lock not implemented yet
0148:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
01b4:fixme:file:NtLockFile I/O completion on lock not implemented yet
01dc:fixme:advapi:SetNamedSecurityInfoW Object type 12 is not currently supported.
01dc:fixme:advapi:SetNamedSecurityInfoW Object type 12 is not currently supported.
0148:err:msi:execute_script Execution of script 0 halted; action L&quot;[C:\\users\\vladimir\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Rutoken\\Getting Started (Russian).url\0080https://www.rutoken.ru/control_panel_getting_started_pdf_ru.html\00801\0080\00800&lt;=&gt;S-1-5-21-0-0-0-1000&lt;=&gt;{9704B6E4-5E0F-4682-8E7B-8F50C3D3A9C3}]WixCreateInternetSh&quot;... returned 1603
0148:err:msi:ITERATE_Actions Execution halted, action L&quot;InstallFinalize&quot; returned 1603
01e4:err:menubuilder:Process_Link unable to load L&quot;C:\\users\\vladimir\\Desktop\\Rutoken Control Panel.lnk&quot;
01e4:err:menubuilder:wWinMain failed to build menu item for L&quot;C:\\users\\vladimir\\Desktop\\Rutoken Control Panel.lnk&quot;
01ec:err:menubuilder:Process_Link unable to load L&quot;C:\\users\\vladimir\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Rutoken\\Rutoken Control Panel.lnk&quot;
01ec:err:menubuilder:wWinMain failed to build menu item for L&quot;C:\\users\\vladimir\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Rutoken\\Rutoken Control Panel.lnk&quot;
01fc:fixme:file:NtLockFile I/O completion on lock not implemented yet
0148:err:msi:execute_script Execution of script 2 halted; action L&quot;[C:\\users\\vladimir\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Rutoken\\Getting Started (Russian).url\0080https://www.rutoken.ru/control_panel_getting_started_pdf_ru.html\00801\0080\00800&lt;=&gt;S-1-5-21-0-0-0-1000&lt;=&gt;{9704B6E4-5E0F-4682-8E7B-8F50C3D3A9C3}]WixRollbackInternet&quot;... returned 1603</code></pre></div><p><strong>Журнал установки:</strong><br /></p><div class="codebox"><pre><code>Key: HKEY_CLASSES_ROOT\CLSID\{3A718858-6969-49D3-AA47-6BBAEB7E58ED}, Name: InfoTip
Key: HKEY_CLASSES_ROOT\CLSID\{3A718858-6969-49D3-AA47-6BBAEB7E58ED}, Name: LocalizedString
Key: HKEY_CLASSES_ROOT\CLSID\{3A718858-6969-49D3-AA47-6BBAEB7E58ED}, Name: System.ApplicationName
Key: HKEY_CLASSES_ROOT\CLSID\{3A718858-6969-49D3-AA47-6BBAEB7E58ED}\DefaultIcon, Name: 
Key: HKEY_CLASSES_ROOT\CLSID\{3A718858-6969-49D3-AA47-6BBAEB7E58ED}\Shell\Open\Command, Name: 
Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\ControlPanel\NameSpace\{3A718858-6969-49D3-AA47-6BBAEB7E58ED}, Name: 
Action ended 09:54:59: RemoveRegistryValues. Return value 1.
Action 09:54:59: WixRollbackInternetShortcuts. 
Action start 09:54:59: WixRollbackInternetShortcuts.
WixRemoveInternetShortcuts:  Error 0x80070103: failed to read shortcut attributes from custom action data
Action ended 09:54:59: WixRollbackInternetShortcuts. Return value 0.</code></pre></div><p>Подгрузка допмодулей через winetricks оказалась безуспешной. <br />Объясните, пожалуйста, что значат эти ошибки и можно ли их избежать?</p><p><strong>Буду благодарен за любую информацию. Заранее спасибо!</strong></p>]]></description>
			<author><![CDATA[null@example.com (v.smetana)]]></author>
			<pubDate>Wed, 25 Jun 2025 07:05:55 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/5323/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Алгоритм генерации последовательности случайных чисел в JRT]]></title>
			<link>https://forum.rutoken.ru/topic/4726/new/posts/</link>
			<description><![CDATA[<p>Добрый день!</p><p>Прошу уточнить какой алгоритм используется для генерации случайных чисел в JRT?</p>]]></description>
			<author><![CDATA[null@example.com (alfeno4ka)]]></author>
			<pubDate>Wed, 11 Jun 2025 11:44:09 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/4726/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Рутокен OTP]]></title>
			<link>https://forum.rutoken.ru/topic/4593/new/posts/</link>
			<description><![CDATA[<p>Здравствуйте. При сохранении настроек токен пишет аутентификация failed. Код ввожу верно.<br /><span class="postimg"><a class="fancybox fancybox.image" rel="group" href="https://forum.rutoken.ru/uploads/images/2025/02/345094b7a35d520e658ca8946f4617c8.jpg"><img class="fb_img" src="https://forum.rutoken.ru/uploads/previews/2025/02/345094b7a35d520e658ca8946f4617c8.jpg" alt="" /></a></span></p>]]></description>
			<author><![CDATA[null@example.com (Ксения Капелькина)]]></author>
			<pubDate>Mon, 17 Feb 2025 16:58:36 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/4593/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Рутокен ЭЦП 3.0 не работает из под IIS]]></title>
			<link>https://forum.rutoken.ru/topic/4583/new/posts/</link>
			<description><![CDATA[<p>Добрый день,</p><p>Пытаюсь вызывать функционал рутокена из IIS работающего под аккаунтом &quot;Local System&quot;.<br />Листинг токенов отрабатывает корректно но при попытке логина выдает ошибку:<br />C_Login: 6, CKR_FUNCTION_FAILED Error</p><p>Если сервер запускается из под обычного пользователя, то работа с токеном происходит корректно.</p><p>Что может быть причиной ошибки?</p>]]></description>
			<author><![CDATA[null@example.com (andydandy)]]></author>
			<pubDate>Thu, 06 Feb 2025 11:59:29 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/4583/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Как получить информацию о контейнерах на РуТокене в Linux в bash?]]></title>
			<link>https://forum.rutoken.ru/topic/4567/new/posts/</link>
			<description><![CDATA[<p>Здравствуйте, подскажите как получить информацию о контейнерах на РуТокене в Linux в командной строке?</p><p>какой утилитой это возможно получить?</p><p>пока интересуют только сами айдишники контейнеров</p><p>но так же интересно и более глубоко - сам сертификат, УЦ, цепочка сертификатов и т.д.</p>]]></description>
			<author><![CDATA[null@example.com (Алексей Вдовин)]]></author>
			<pubDate>Tue, 28 Jan 2025 08:18:05 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/4567/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[c#. Рутокен 3.0. Ubuntu 20  Value cannot be null. (Parameter 'source')]]></title>
			<link>https://forum.rutoken.ru/topic/4565/new/posts/</link>
			<description><![CDATA[<p>Добрый день.</p><p>Возникает Exception при подписывании документа PKCS7Sign().</p><p>Value cannot be null. (Parameter &#039;source&#039;)</p><p>Использую NuGet<br />Aktiv.RutokenPkcs11Interop 2.0.11<br />Pkcs11Interop 4.1.1</p><p>Через браузер, на демо портале все работает.</p><br /><br /><p>Подскажите, пожалуйста, в чем причина?</p><div class="codebox"><pre><code>        public byte[] Sign(string FilePath, bool isSignAttached = true)
        {
            Net.Pkcs11Interop.HighLevelAPI.ObjectHandle certificate = new();

            Net.Pkcs11Interop.HighLevelAPI.ObjectHandle privateKey = new();

            try
            {
                string mydll = @&quot;./librtpkcs11ecp.so&quot;;                

                Console.WriteLine($&quot;mydll: {mydll}&quot;);

                using (var pkcs11 = new Pkcs11(mydll, AppType.SingleThreaded))
                {

                    Slot slot = Helpers.GetUsableSlot(pkcs11);                                      // Find first slot with token present

                    using (Session session = slot.OpenSession(SessionType.ReadWrite))
                    {
                        session.Login(CKU.CKU_USER, _password);

                        var pairs = GetCertAndKey(session, _ckaId);                        

                        byte[] ar = File.ReadAllBytes(FilePath);

                        return session.PKCS7Sign(ar, pairs[0].cert, pairs[0].key, null, SampleConstants.UseHardwareHash);       // Подпись данных c присоединенной подписью

                    }
                }
            }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (dahilu)]]></author>
			<pubDate>Fri, 24 Jan 2025 13:04:39 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/4565/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Определение версии Рутокена ЭЦП 2.0 или 3.0]]></title>
			<link>https://forum.rutoken.ru/topic/4552/new/posts/</link>
			<description><![CDATA[<p>Добрый день. Подскажите как получить версию Рутокена (2.0 или 3.0) через плагин в браузере?<br />Документация: <a href="https://plugin.api.rutoken.ru/CryptoPlugin.html">https://plugin.api.rutoken.ru/CryptoPlugin.html</a><br />Смотрел в документации метод getDeviceInfo(deviceId, option) → {object}, но там не нашел нужного мне параметра<br />Также на сайте <a href="https://aktivco.github.io/rutoken-plugin-demo/">https://aktivco.github.io/rutoken-plugin-demo/</a> пробовал разные параметры получения информации о токене, но не один из них не возвращает версию Рутокена.</p>]]></description>
			<author><![CDATA[null@example.com (kgurin)]]></author>
			<pubDate>Tue, 14 Jan 2025 13:54:24 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/4552/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Проблема с RSA PKCS11]]></title>
			<link>https://forum.rutoken.ru/topic/4549/new/posts/</link>
			<description><![CDATA[<p>УТМ не может установить соединение с сервером ЕГАИС<br />из-за проблем с хранилищем RSA ключей.</p><p>Здравствуйте.<br />Помогите пожалуйста разобраться в чем причина.</p>]]></description>
			<author><![CDATA[null@example.com (geo_nn)]]></author>
			<pubDate>Thu, 09 Jan 2025 15:34:23 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/4549/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Проброс токена с windows до linux]]></title>
			<link>https://forum.rutoken.ru/topic/4518/new/posts/</link>
			<description><![CDATA[<p>Добрый день.<br />Есть rutoken lite, хочется узнать, знаете ли нормальный способ пробросить его с windows машины до linux (ubuntu) машины?</p><p>Насколько я знаю проброс с windows до windows делается через обычное подключение rdp. Также видел у вас статьи про проброс в QEMU, через шаринг linux процесса pcscd.comm между 2 linux машинами. Но вот статьи с windows до linux не смог найти.</p>]]></description>
			<author><![CDATA[null@example.com (andreyfrolov)]]></author>
			<pubDate>Mon, 02 Dec 2024 15:02:29 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/4518/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Библиотека "librtpkcs11ecp.so" не работает с Alt Linux]]></title>
			<link>https://forum.rutoken.ru/topic/4507/new/posts/</link>
			<description><![CDATA[<p>Добрый день,</p><p>Собрал и запустил такой тестовый пример на <strong>Alt Simply Linux 10.2 </strong>(Captain Finn):</p><div class="codebox"><pre><code>#include &lt;cryptoki/rtpkcs11.h&gt;
#include &lt;dlfcn.h&gt;

#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;

int main(int argc, const char* argv[]) {
    CK_FUNCTION_LIST_PTR functionList;
    CK_C_GetFunctionList pGetFunctionList;

    void* handle = dlopen(&quot;./librtpkcs11ecp.so&quot;, RTLD_NOW);
    if (!handle) {
        std::cerr &lt;&lt; &quot;Can&#039;t upload PKCS#11 library\n&quot; &lt;&lt; dlerror() &lt;&lt; std::endl;
        return 1;
    }
    //**************************************************************************
    pGetFunctionList = (CK_C_GetFunctionList)dlsym(handle, &quot;C_GetFunctionList&quot;);
    if (!pGetFunctionList) {
        std::cerr &lt;&lt; &quot;Can&#039;t find C_GetFunctionList.&quot; &lt;&lt; std::endl;
        return 1;
    }

    //**************************************************************************
    CK_RV rv = pGetFunctionList(&amp;functionList);
    if (rv != CKR_OK) {
        std::cerr &lt;&lt; &quot;C_GetFunctionList error: &quot; &lt;&lt; rv &lt;&lt; std::endl;
        return 1;
    }

    //**************************************************************************
    CK_C_INITIALIZE_ARGS initArgs = {NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, CKF_OS_LOCKING_OK, NULL_PTR};
    rv = functionList-&gt;C_Initialize(&amp;initArgs);
    // rv = functionList-&gt;C_Initialize(NULL_PTR);
    if (rv != CKR_OK &amp;&amp; rv != CKR_CRYPTOKI_ALREADY_INITIALIZED) {
        std::cerr &lt;&lt; &quot;C_Initialize error: &quot; &lt;&lt; rv &lt;&lt; std::endl;
        return 1;
    }

    //**************************************************************************
    CK_INFO info;
    rv = functionList-&gt;C_GetInfo(&amp;info);
    if (rv != CKR_OK) {
        std::cerr &lt;&lt; &quot;C_GetInfo error: &quot; &lt;&lt; rv &lt;&lt; std::endl;
        return 1;
    }
    std::cout &lt;&lt; &quot;C_GetInfo.desc = \&quot;&quot;
              &lt;&lt; std::string((const char*)info.libraryDescription, sizeof(info.libraryDescription)) &lt;&lt; &quot;\&quot;&quot;
              &lt;&lt; std::endl;
    std::cout &lt;&lt; &quot;C_GetInfo.flags = &quot; &lt;&lt; info.flags &lt;&lt; std::endl;
    std::cout &lt;&lt; &quot;C_GetInfo.cryptokiVer = &quot; &lt;&lt; (int)info.cryptokiVersion.major &lt;&lt; &quot;.&quot; &lt;&lt; (int)info.cryptokiVersion.minor
              &lt;&lt; std::endl;
    std::cout &lt;&lt; &quot;C_GetInfo.libraryVer = &quot; &lt;&lt; (int)info.libraryVersion.major &lt;&lt; &quot;.&quot; &lt;&lt; (int)info.libraryVersion.minor
              &lt;&lt; std::endl;

    //**************************************************************************
    CK_ULONG counter;
    rv = functionList-&gt;C_GetSlotList(CK_FALSE, NULL_PTR, &amp;counter);
    if (rv != CKR_OK) {
        std::cerr &lt;&lt; &quot;C_GetSlotList(FALSE) error: &quot; &lt;&lt; rv &lt;&lt; std::endl;
        return 1;
    }
    std::cout &lt;&lt; &quot;C_GetSlotList(FALSE).counter = &quot; &lt;&lt; counter &lt;&lt; std::endl;

    //**************************************************************************
    rv = functionList-&gt;C_GetSlotList(CK_TRUE, NULL_PTR, &amp;counter);
    if (rv != CKR_OK) {
        std::cerr &lt;&lt; &quot;C_GetSlotList(TRUE) error: &quot; &lt;&lt; rv &lt;&lt; std::endl;
        return 1;
    }
    std::cout &lt;&lt; &quot;C_GetSlotList(TRUE).counter = &quot; &lt;&lt; counter &lt;&lt; std::endl;

    //**************************************************************************
    std::cout &lt;&lt; &quot;before C_Finalize&quot; &lt;&lt; std::endl;
    rv = functionList-&gt;C_Finalize(NULL);
    if (rv != CKR_OK) {
        std::cerr &lt;&lt; &quot;C_Finalize error: &quot; &lt;&lt; rv &lt;&lt; std::endl;
        return 1;
    }
    std::cout &lt;&lt; &quot;after C_Finalize&quot; &lt;&lt; std::endl;

    dlclose(handle);
    return 0;
}</code></pre></div><p>Библиотека берется отсюда:<br />&quot;RutokenSDK\pkcs11\lib\linux_glibc-x86_64\librtpkcs11ecp.so&quot;</p><p><strong>1. Программа виснет на вызове C_Finalize(). </strong><br /></p><div class="codebox"><pre><code>[user@host-15 RutokenTest]$ ./RutokenTest
C_GetInfo.desc = &quot;Rutoken ECP PKCS #11 library    &quot;
C_GetInfo.flags = 0
C_GetInfo.cryptokiVer = 2.40
C_GetInfo.libraryVer = 2.13
C_GetSlotList(FALSE).counter = 15
C_GetSlotList(TRUE).counter = 0
before C_Finalize</code></pre></div><p>&nbsp; &nbsp; Без разницы которая из C_Initialize вызвана:<br />&nbsp; &nbsp; rv = functionList-&gt;C_Initialize(&amp;initArgs);<br />&nbsp; &nbsp; или rv = functionList-&gt;C_Initialize(NULL_PTR);<br />&nbsp; &nbsp; <br />CALL STACK:<br /><span class="postimg"><a class="fancybox fancybox.image" rel="group" href="https://forum.rutoken.ru/uploads/images/2024/11/aa5719385f5b23a9b528e02bcca6b257.png"><img class="fb_img" src="https://forum.rutoken.ru/uploads/previews/2024/11/aa5719385f5b23a9b528e02bcca6b257.png" alt="" /></a></span> </p><p>Зависание происходит как при наличии подключенных токенов, так и при их отсутствии.<br />&nbsp; &nbsp; <br /><strong>2. Подключил два токена Rutoken ECP 3.0, программ их не видит:</strong><br /></p><div class="codebox"><pre><code>[user@host-15 RutokenTest]$ ./RutokenTest
C_GetInfo.desc = &quot;Rutoken ECP PKCS #11 library    &quot;
C_GetInfo.flags = 0
C_GetInfo.cryptokiVer = 2.40
C_GetInfo.libraryVer = 2.13
C_GetSlotList(FALSE).counter = 15
C_GetSlotList(TRUE).counter = 0
before C_Finalize</code></pre></div><p><span class="bbu">Библиотека сообщает об отсутствии подключенных токенов.</span> <strong>C_GetSlotList(TRUE).counter = 0</strong></p><p>Если добавить такой код:<br /></p><div class="codebox"><pre><code>std::vector&lt;CK_SLOT_ID&gt; slots(counter);
rv = functionList-&gt;C_GetSlotList(CK_FALSE, slots.data(), &amp;counter);
if (rv != CKR_OK) {
    std::cerr &lt;&lt; &quot;C_GetSlotList(FALSE, data) error: &quot; &lt;&lt; rv &lt;&lt; std::endl;
    return 1;
}

for (auto&amp; slot : slots) {
    CK_SLOT_INFO slotInfo;
    rv = functionList-&gt;C_GetSlotInfo(slot, &amp;slotInfo);
    if (rv != CKR_OK) {
        std::cerr &lt;&lt; &quot;C_GetSlotInfo error: &quot; &lt;&lt; rv &lt;&lt; &quot; slot: &quot; &lt;&lt; slot &lt;&lt; std::endl;
        return 1;
    }

    std::cout &lt;&lt; &quot;slot: &quot; &lt;&lt; slot &lt;&lt; std::endl;
    std::cout &lt;&lt; &quot;C_GetSlotInfo.desc = \&quot;&quot;
              &lt;&lt; std::string((const char*)slotInfo.slotDescription, sizeof(slotInfo.slotDescription)) &lt;&lt; &quot;\&quot;&quot;
              &lt;&lt; std::endl;
    std::cout &lt;&lt; &quot;C_GetSlotInfo.flags = &quot; &lt;&lt; slotInfo.flags &lt;&lt; std::endl;
}</code></pre></div><p>Программа распечатает 15 пустышек:<br /></p><div class="codebox"><pre><code>slot: 0
C_GetSlotInfo.desc = &quot;                                                                &quot;
C_GetSlotInfo.flags = 6
slot: 1
C_GetSlotInfo.desc = &quot;                                                                &quot;
C_GetSlotInfo.flags = 6

...</code></pre></div><p><strong>Что может быть причиной проблем с зависанием и неспособностью увидеть подключенный токен?</strong></p><p>P.S. На <strong>Astra Linux 1.8</strong>, этот пример работает <strong>корректно</strong>...</p>]]></description>
			<author><![CDATA[null@example.com (andydandy)]]></author>
			<pubDate>Fri, 08 Nov 2024 02:26:39 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/4507/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Рутокен ЭЦП 3.0 как отформатировать/сбросить в заводские настройки?]]></title>
			<link>https://forum.rutoken.ru/topic/4494/new/posts/</link>
			<description><![CDATA[<p>Привет,</p><p>Есть необходимость реанимировать/отформатировать/скинуть в заводские настройки Рутокен ЭЦП 3.0 или 2.0<br />у которого утеряны все пин коды.</p><p>Использую для этого функцию C_EX_InitToken:<br /></p><div class="codebox"><pre><code>    void format() {
        CK_RUTOKEN_INIT_PARAM ckRtInitParams;
        ckRtInitParams.ulSizeofThisStructure = sizeof(CK_RUTOKEN_INIT_PARAM);
        ckRtInitParams.UseRepairMode = 1;
        ckRtInitParams.pNewAdminPin = SO_PIN;
        ckRtInitParams.ulNewAdminPinLen = sizeof(SO_PIN);
        ckRtInitParams.pNewUserPin = USER_PIN; 
        ckRtInitParams.ulNewUserPinLen = sizeof(USER_PIN);
        ckRtInitParams.ChangeUserPINPolicy =
            TOKEN_FLAGS_ADMIN_CHANGE_USER_PIN | TOKEN_FLAGS_USER_CHANGE_USER_PIN;
        ckRtInitParams.ulMinAdminPinLen = 6;
        ckRtInitParams.ulMinUserPinLen = 6; 
        ckRtInitParams.ulMaxAdminRetryCount = 10;
        ckRtInitParams.ulMaxUserRetryCount = 10;
        ckRtInitParams.pTokenLabel = TOKEN_LABEL;
        ckRtInitParams.ulLabelLen = sizeof(TOKEN_LABEL);
        ckRtInitParams.ulSmMode = 0;

        CK_RV rv = m_pkcs11Library.getFunctionListExt()-&gt;C_EX_InitToken(
                 m_slot, 
                 SO_PIN, 
                 sizeof(SO_PIN), 
                 &amp;ckRtInitParams
        );
        if (rv != CKR_OK) {
            throw std::runtime_error(to_string(rv));
        }
    }</code></pre></div><p>Методом научного тыка выяснил, что для случая утерянных пинкодов, C_EX_InitToken нужно вызвать вхолостую до 10 раз, <br />пока пинкод администратора не залочится, и только потом она отработает.</p><p><strong>0.</strong> Есть способ запустить C_EX_InitToken без лока пинкода администратора?<br />По крайней мере без десятка холостых вызовов с пинкодом.</p><p><strong>1.</strong> Правильно я понимаю, что параметр UseRepairMode определяет только то, как отработает C_EX_InitToken.<br />Т.е. UseRepairMode не записыватся на токен во время форматирования и никак не влияет на его дальнейшую работу?<br />И если пин администратора залочен то C_EX_InitToken отработает только в случае UseRepairMode!=0? И это единственная его функция?</p><p><strong>2.</strong> Чем упраляет ulSmMode?</p><p><strong>3.</strong> В rtpkcs11t.h есть такой код:<br /></p><div class="codebox"><pre><code>/* C_EX_SlotManage mode */
#define MODE_RESTORE_FACTORY_DEFAULTS    0x06UL
#define MODE_GET_PIN_SET_TO_BE_CHANGED   0x07UL

/* Data structure to be used in C_EX_SlotManage - extended function with
 * MODE_RESTORE_FACTORY_DEFAULTS for token supporting trusted import */
typedef struct CK_VENDOR_RESTORE_FACTORY_DEFAULTS_PARAMS {
  CK_ULONG                  ulSizeofThisStructure;      /* [in] init this field by size of this structure. For example -
                                                             st.ulSizeofThisStructure = sizeof(CK_RUTOKEN_CHANGE_EMITENT_PASS_PARAM) */
  CK_BYTE_PTR               pAdminPin;                  /* [in] pointer to byte array with current admin PIN */
  CK_ULONG                  ulAdminPinLen;              /* [in] length of current admin PIN */
  CK_RUTOKEN_INIT_PARAM_PTR pInitParam;                 /* [in] pointer to structure with initialization params*/
  CK_BYTE_PTR               pNewEmitentKey;             /* [in] pointer to byte array with new emitent key (32 bytes) */
  CK_ULONG                  ulNewEmitentKeyLen;         /* [in] length of new emitent key (32) */
  CK_ULONG                  ulNewEmitentKeyRetryCount;  /* [in] emitent key retry count */
} CK_VENDOR_RESTORE_FACTORY_DEFAULTS_PARAMS;</code></pre></div><p>Это еще один способ сброситься в заводские настройки помимо C_EX_InitToken, но через C_EX_SlotManage? <br />Если да, то где можно найти пример использования?<br />В описании C_EX_SlotManage на сайте, не нашел упоминания про MODE_RESTORE_FACTORY_DEFAULTS.</p>]]></description>
			<author><![CDATA[null@example.com (andydandy)]]></author>
			<pubDate>Wed, 23 Oct 2024 06:26:58 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/4494/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Рутокен ЭЦП 3.0 вопросы по pkcs11]]></title>
			<link>https://forum.rutoken.ru/topic/4485/new/posts/</link>
			<description><![CDATA[<p>Привет, </p><p><strong>Есть П.О. на с++ которое: </strong><br />1. Получает сообщение зашифрованное открытым ключем 3072 бит (по алгоритму RSA с OAEP и SHA-1) и расшифровывает его закрытым ключем.<br />2. С помошью закрытого ключа, генерирует цифровую подпись (по алгоритму RSA PKCS#1 v1.5 и SHA-1).</p><p><strong>Задача: </strong><br />- Перенести выполнение описаных выше функций, на устройство Рутокен ЭЦП 3.0. Использовать библиотеку pkcs11.</p><p><strong>1.</strong> Загрузка закрытого ключа на рутокен:<br />&nbsp; &nbsp; Загружаю ключ с помошью `C_CreateObject`:<br />&nbsp; &nbsp; <br /></p><div class="codebox"><pre><code>    CK_RV rv = functionList-&gt;C_CreateObject(session,
                                            privateKeyTemplate,
                                            sizeof(privateKeyTemplate) / sizeof(CK_ATTRIBUTE),
                                            &amp;privateKeyHandle);</code></pre></div><p>&nbsp; &nbsp; <br /><strong>Мне не удалось загрузить ключ размером 3072 бит, но загрузились все остальные. </strong><br /><strong>Я правильно понимаю что Рутокен ЭЦП 3.0 поддерживает только 512, 1024, 2048, 4096 длины ключей? </strong></p><p><strong>2.</strong> Дешифровка сообщения RSA с OAEP и SHA-1:<br />&nbsp; &nbsp; Пытаюсь провести инициализацию:</p><div class="codebox"><pre><code>    CK_RSA_PKCS_OAEP_PARAMS oaepParams;
    oaepParams.hashAlg = CKM_SHA_1;
    oaepParams.mgf = CKG_MGF1_SHA1;
    oaepParams.source = CKZ_DATA_SPECIFIED;
    oaepParams.pSourceData = NULL;
    oaepParams.ulSourceDataLen = 0;

    CK_MECHANISM mechanism;
    mechanism.mechanism = CKM_RSA_PKCS_OAEP;
    mechanism.pParameter = &amp;oaepParams;
    mechanism.ulParameterLen = sizeof(oaepParams);
    
    CK_RV rv = functionList-&gt;C_DecryptInit(session, &amp;mechanism, privKeys[0]);</code></pre></div><p>&nbsp; &nbsp; В качестве референса я использовал код утилиты pkcs11-tool от OpenSC и описание стандарта PKCS#11 current mechanisms v2.40.<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; `C_DecryptInit` возвращал ошибку, пока я не заменил `oaepParams.source = CKZ_DATA_SPECIFIED;` на `oaepParams.source = 0;`<br />&nbsp; &nbsp; C `oaepParams.source = 0;` код работает и сообщение дешифруется.<br />&nbsp; &nbsp; <br /><strong>Можете сказать почему рутокен ожидает `oaepParams.source = 0;` в то время как например pkcs11-tool устанавливает `oaepParams.source = CKZ_DATA_SPECIFIED;` в аналогичной ситуации? </strong><br /><strong>Где в стандарте или в каких-нибудь других поясняющих документах это описано? </strong></p><p><strong>3.</strong> Цифровая подпись RSA PKCS#1 v1.5 и SHA-1:</p><div class="codebox"><pre><code>    CK_MECHANISM rsaSigVerMechWithSha1 = { CKM_SHA1_RSA_PKCS, NULL_PTR, 0 };
    CK_RV rv = functionList-&gt;C_SignInit(session, &amp;rsaSigVerMechWithSha1, objects[0]);</code></pre></div><p><em>Отработала без сюрпризов </em></p>]]></description>
			<author><![CDATA[null@example.com (andydandy)]]></author>
			<pubDate>Mon, 14 Oct 2024 17:53:21 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/4485/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Скорость работы Рутокен ЭЦП 2.0]]></title>
			<link>https://forum.rutoken.ru/topic/4482/new/posts/</link>
			<description><![CDATA[<p>Здравствуйте!</p><p>Интересует такой технический момент: какая скорость работы токена (Рутокен ЭЦП 2.0)?</p><p>Тут стоит пояснить. У нас токен используется на сервере для подписания запросов. И доступ к токену реализован через брокера сообщений, для того чтобы в единицу времени производилась только одна подпись.</p><p>Может ли токен сам обрабатывать несколько одновременных обращений? И если может, то какое ограничение?</p>]]></description>
			<author><![CDATA[null@example.com (vanobl)]]></author>
			<pubDate>Thu, 10 Oct 2024 09:44:07 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/4482/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Bad Parameters при проверке подписи рутокена]]></title>
			<link>https://forum.rutoken.ru/topic/4472/new/posts/</link>
			<description><![CDATA[<p>Сформированы 2 ключа, на 1 ключе установлен сертификат который шифрует и подписывает сообщение<br />на 2 ключе сертификат который отвечает за расшифровку и проверку подписи</p><p>Код который вызывает проверку подписи:</p><p><span class="postimg"><a class="fancybox fancybox.image" rel="group" href="https://forum.rutoken.ru/uploads/images/2024/10/d3af0a4f560875ba535ba0a0c368236d.png"><img class="fb_img" src="https://forum.rutoken.ru/uploads/previews/2024/10/d3af0a4f560875ba535ba0a0c368236d.png" alt="" /></a></span> </p><p><span class="postimg"><a class="fancybox fancybox.image" rel="group" href="https://forum.rutoken.ru/uploads/images/2024/10/95e81b5e3ba47c976ab22a404416a231.png"><img class="fb_img" src="https://forum.rutoken.ru/uploads/previews/2024/10/95e81b5e3ba47c976ab22a404416a231.png" alt="" /></a></span> </p><br /><p>Аргументами передается значение подписи , файл сертификата отправителя&nbsp; и корневой сертификат</p><p>В ходе выполнения кода происходит исключение которое выдает сообщение Bad Parameters</p><br /><p>Сертификат получателя:</p><p>Public Key Object; GOSTR3410<br />&nbsp; PARAMS OID: 06072a850302022301<br />&nbsp; VALUE:&nbsp; &nbsp; &nbsp; b62e05200a68c6d465e36252651c5cb919a120d0f861805cc52b7be8ac611f08<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 8d4f34035972a40805b01df4680637045c477a6cbf3e22458d58fcdaf06765af<br />&nbsp; label:<br />&nbsp; ID:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8d877ac06d6e3057309ad4bc43ded58c0850b9d0<br />&nbsp; Usage:&nbsp; &nbsp; &nbsp; verify<br />Certificate Object; type = X.509 cert<br />&nbsp; label:&nbsp; &nbsp; &nbsp; Rutoken Plugin<br />&nbsp; subject:&nbsp; &nbsp; DN: CN=Streamlabs, SN=Stream, GN=Labs Stream<br />&nbsp; ID:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8d877ac06d6e3057309ad4bc43ded58c0850b9d0<br />Certificate Object; type = X.509 cert<br />&nbsp; label:&nbsp; &nbsp; &nbsp; Rutoken Plugin<br />&nbsp; subject:&nbsp; &nbsp; DN: ST=Moscow, L=Moscow, O=AO Aktiv-Soft, OU=Rutoken, CN=Rutoken TEST CA GOST<br />&nbsp; ID:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;a3ebb61052dd9625c8221eea5d8b49d5e0534f92<br />Certificate Object; type = X.509 cert<br />&nbsp; label:&nbsp; &nbsp; &nbsp; Rutoken Plugin<br />&nbsp; subject:&nbsp; &nbsp; DN: ST=Moscow, L=Moscow, O=AO Aktiv-Soft, OU=Rutoken, CN=Rutoken TEST CA RSA<br />&nbsp; ID:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;f7c656e7675591ae723c7ae9ec97929c8c9beda3</p><br /><p>Сертификат отправителя:<br /><span class="postimg"><a class="fancybox fancybox.image" rel="group" href="https://forum.rutoken.ru/uploads/images/2024/10/80c7a47e2b02121e584edb880dd4f9a0.png"><img class="fb_img" src="https://forum.rutoken.ru/uploads/previews/2024/10/80c7a47e2b02121e584edb880dd4f9a0.png" alt="" /></a></span></p><br /><p>При использовании этих сертификатов на ключах, расшифровка сообщения происходит успешно, но проверка подписи не проходит, вылетает вышеупомянутое исключение с сообщением bad parameters, используется sdk libpki-core.so.1.15</p>]]></description>
			<author><![CDATA[null@example.com (rxnsx)]]></author>
			<pubDate>Thu, 03 Oct 2024 13:54:49 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/4472/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[CryptoAPI: Очень долгое CryptReleaseContext  Rutoken CSP v 1.0]]></title>
			<link>https://forum.rutoken.ru/topic/4439/new/posts/</link>
			<description><![CDATA[<p>Здравствуйте.<br />у клиента появилась проблема: зависает наш софт, зависает именно на освобождении контекста провайдера Rutoken CSP v 1.0 - самое долгое 2 с лишним часа.<br /></p><div class="codebox"><pre><code>DWORD index = 0;
    DWORD len = 0;
    DWORD provType;
    CString provName;
    HCRYPTPROV prov(0);
    while (CryptEnumProviders(index, 0, 0, &amp;provType, 0, &amp;len))
    {
        if (CryptEnumProviders(index, 0, 0, &amp;provType, provName.GetBufferSetLength(len), &amp;len))
        {
            provName.ReleaseBuffer();
            ca_log_event(L&quot;CryptAcquireContext CSP &quot; + provName, false);
            if (CryptAcquireContext(&amp;prov, 0, provName, provType, CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
            {
                if (AlgorithmIsSupported(prov, algId, keyLength))
                {
                    ca_log_event(L&quot;CSP found &quot; + provName, false);
                    break;
                }
                ca_log_event(L&quot;CryptReleaseContext CSP &quot; + provName, false);
                CryptReleaseContext(prov, 0);
                prov = 0;
            }
            else
            {
                ca_log_err(GetLastError());
            }
        }
        index++;
    }</code></pre></div><p>Лог для наглядности:<br /></p><div class="codebox"><pre><code>03.09.2024 16:13:30.164 (ThreadId: 7312) FindProvByAlgId: CryptAcquireContext CSP Aktiv ruToken CSP v1.0
03.09.2024 16:13:30.975 (ThreadId: 7312) FindProvByAlgId: CryptReleaseContext CSP Aktiv ruToken CSP v1.0
03.09.2024 18:42:49.247 (ThreadId: 7312) FindProvByAlgId: CryptAcquireContext CSP FCP Cryptographic Service Provider
03.09.2024 18:42:49.247 (ThreadId: 7312) FindProvByAlgId: CryptReleaseContext CSP FCP Cryptographic Service Provider</code></pre></div><p>Далее попытка следующего вызова функции завершается с ошибкой(формулировка наша, но код ошибки есть):<br /></p><div class="codebox"><pre><code>03.09.2024 18:42:49.250 (ThreadId: 7312) FindProvByAlgId: CryptAcquireContext CSP Aktiv ruToken CSP v1.0
ERROR 03.09.2024 18:42:49.257 (ThreadId: 7312) FindProvByAlgId: Контекст криптопровайдера не был получен, или уже был освобожден
ERROR 03.09.2024 18:42:49.257 (ThreadId: 7312) FindProvByAlgId: Thu Dec 22 02:25:51 2022; CryptUtil.cpp:526
ERROR 03.09.2024 18:42:49.259 (ThreadId: 7312) FindProvByAlgId: ERROR Неизвестная ошибка. (0x8010001d)</code></pre></div><p>Подскажите, пожалуйста, в чем может быть причина и как решить проблему?</p>]]></description>
			<author><![CDATA[null@example.com (brend)]]></author>
			<pubDate>Thu, 05 Sep 2024 11:33:53 +0000</pubDate>
			<guid>https://forum.rutoken.ru/topic/4439/new/posts/</guid>
		</item>
	</channel>
</rss>
