<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум Рутокен &mdash; Создание неизвлекаемых ключей через PKCS#11]]></title>
	<link rel="self" href="https://forum.rutoken.ru/feed/atom/topic/3004/" />
	<updated>2019-07-16T08:58:16Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.rutoken.ru/topic/3004/</id>
		<entry>
			<title type="html"><![CDATA[Re: Создание неизвлекаемых ключей через PKCS#11]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/13079/#p13079" />
			<content type="html"><![CDATA[<p>Добрый день, <br />Вы совершенно правы. ГОСТы 2012-й серии поддерживаются только в Рутокен ECP 2.0 (микропрограмма 23 и выше).<br />Судя по вашему первому письму, у вас Рутокен ECP 1.0 микропрограмма 18. </p><p>Таблица поддержки функционала PKCS для разных моделей наших устройств представлена <a href="https://dev.rutoken.ru/pages/viewpage.action?pageId=3178534">здесь</a>. <br />Таблицу поддержки конкретных механизмов <a href="https://dev.rutoken.ru/pages/viewpage.action?pageId=3178538">здесь</a></p><p>Мы постараемся актуализировать данную информацию в ближайшее время.</p><p>С уважением, <br />Алексей Лазарев</p>]]></content>
			<author>
				<name><![CDATA[Алексей Лазарев]]></name>
				<uri>https://forum.rutoken.ru/user/9383/</uri>
			</author>
			<updated>2019-07-16T08:58:16Z</updated>
			<id>https://forum.rutoken.ru/post/13079/#p13079</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Создание неизвлекаемых ключей через PKCS#11]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/13078/#p13078" />
			<content type="html"><![CDATA[<p>Здравствуйте.<br /></p><div class="quotebox"><cite>crazy_blu пишет:</cite><blockquote><p>Теперь новый вопрос. Продукт (интересен новый, естественно, Рутокен ЭЦП 2.0) сертифицирован, в сертификате стоит ссылка на формуляр. В формуляре должна быть ссылка на документы, описывающие необходимый набор параметров для применения этой функциональности. Где можно увидеть такой документ?</p></blockquote></div><p>По этому вопросу напишите, пожалуйста, на info@rutoken.ru</p>]]></content>
			<author>
				<name><![CDATA[Антон Тихиенко]]></name>
				<uri>https://forum.rutoken.ru/user/8822/</uri>
			</author>
			<updated>2019-07-16T08:57:39Z</updated>
			<id>https://forum.rutoken.ru/post/13078/#p13078</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Создание неизвлекаемых ключей через PKCS#11]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/13077/#p13077" />
			<content type="html"><![CDATA[<p>Дополнительные эксперименты показали следующее:<br />1. &quot;Рутокен ЭЦП&quot; (старая модель hw20.4/fw18.11) формально не поддерживает алгоритмы 2012 года. Видимо поэтому передаваемый OID хеша 2012 года ему не нравится.<br />2. Узнать о поддержке 2012 года можно из разбора списка механизмов.<br />3. Фактически атрибут CKA_GOSTR3411_PARAMS можно выбросить из списка параметров, оба токена воспринимают запрос и создают неизвлекаемый ключ.</p><p>Теперь новый вопрос. Продукт (интересен новый, естественно, Рутокен ЭЦП 2.0) сертифицирован, в сертификате стоит ссылка на формуляр. В формуляре должна быть ссылка на документы, описывающие необходимый набор параметров для применения этой функциональности. Где можно увидеть такой документ?</p>]]></content>
			<author>
				<name><![CDATA[crazy_blu]]></name>
				<uri>https://forum.rutoken.ru/user/9574/</uri>
			</author>
			<updated>2019-07-16T08:32:08Z</updated>
			<id>https://forum.rutoken.ru/post/13077/#p13077</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Создание неизвлекаемых ключей через PKCS#11]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/13076/#p13076" />
			<content type="html"><![CDATA[<p>Модель &quot;Rutoken ECP&quot;<br />Hardware version v20.4<br />Firnware version v18.11</p><p>SDK version 280619<br />Система Windos 10 Pro x64<br />Приложение для x64/debug из-под VC 2017</p><p>Открыл сессию hSession, успешно залогинился.</p><p>&nbsp; /* Набор параметров КриптоПро A алгоритма ГОСТ Р 34.10-2001 */<br />&nbsp; CK_BYTE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;paramsGostR3410[] = { 0x06, 0x07, 0x2a, 0x85, 0x03, 0x02, 0x02, 0x23, 0x01 };<br />&nbsp; static CK_UTF8CHAR publicKeyLabelGost2012_256_1[] = &quot;test1&quot;;<br />&nbsp; static CK_UTF8CHAR privateKeyLabelGost2012_256_1[] = &quot;test2&quot;;<br />&nbsp; static CK_BYTE&nbsp; &nbsp; &nbsp;testName[] = &quot;test3&quot;;</p><p>&nbsp; CK_MECHANISM&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; genKeyMechanism = { CKM_GOSTR3410_KEY_PAIR_GEN, NULL_PTR, 0 };<br />&nbsp; CK_OBJECT_CLASS&nbsp; &nbsp; &nbsp; &nbsp;ocPrivKey&nbsp; &nbsp; &nbsp; &nbsp;= CKO_PRIVATE_KEY;<br />&nbsp; CK_OBJECT_CLASS&nbsp; &nbsp; &nbsp; &nbsp;ocPubKey&nbsp; &nbsp; &nbsp; &nbsp; = CKO_PUBLIC_KEY;<br />&nbsp; CK_KEY_TYPE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;keyType = CKK_GOSTR3410;</p><p>&nbsp; CK_BBOOL&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bTrue = CK_TRUE;<br />&nbsp; CK_BBOOL&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bFalse = CK_FALSE;<br />&nbsp; /* Набор параметров КриптоПро алгоритма ГОСТ Р 34.11-2012(256) */<br />&nbsp; CK_BYTE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;paramsGostR3411[] = { 0x06, 0x08, 0x2a, 0x85, 0x03, 0x07, 0x01, 0x01, 0x02, 0x02 };<br />&nbsp; CK_OBJECT_HANDLE&nbsp; &nbsp; &nbsp; hPublicKey = NULL_PTR;&nbsp; &nbsp; // Хэндл открытого ключа<br />&nbsp; CK_OBJECT_HANDLE&nbsp; &nbsp; &nbsp; hPrivateKey = NULL_PTR;&nbsp; &nbsp; // Хэндл закрытого ключа<br />&nbsp; CK_ATTRIBUTE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; privKeyTemplate[] =<br />&nbsp; {<br />&nbsp; &nbsp; { CKA_CLASS, &amp;ocPrivKey, sizeof(ocPrivKey) },<br />&nbsp; &nbsp; { CKA_LABEL, privateKeyLabelGost2012_256_1, strlen(privateKeyLabelGost2012_256_1) },<br />&nbsp; &nbsp; { CKA_ID, testName, strlen(testName) },<br />&nbsp; &nbsp; { CKA_KEY_TYPE, &amp;keyType, sizeof(keyType) },<br />&nbsp; &nbsp; { CKA_TOKEN, &amp;bTrue, sizeof(bTrue) },<br />&nbsp; &nbsp; { CKA_PRIVATE, &amp;bTrue, sizeof(bTrue) },<br />&nbsp; &nbsp; { CKA_GOSTR3410_PARAMS, paramsGostR3410, sizeof(paramsGostR3410) },<br />&nbsp; &nbsp; { CKA_GOSTR3411_PARAMS, paramsGostR3411, sizeof(paramsGostR3411) }<br />&nbsp; };<br />&nbsp; // шаблон открытого ключа<br />&nbsp; CK_ATTRIBUTE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pubKeyTemplate[] =<br />&nbsp; {<br />&nbsp; &nbsp; { CKA_CLASS, &amp;ocPubKey, sizeof(ocPubKey) },<br />&nbsp; &nbsp; { CKA_ID, testName, strlen(testName) },&nbsp; <br />&nbsp; &nbsp; { CKA_LABEL, publicKeyLabelGost2012_256_1, strlen(publicKeyLabelGost2012_256_1) }, <br />&nbsp; &nbsp; { CKA_KEY_TYPE, &amp;keyType, sizeof(keyType) },<br />&nbsp; &nbsp; { CKA_TOKEN, &amp;bTrue, sizeof(bTrue) },<br />&nbsp; &nbsp; { CKA_PRIVATE, &amp;bFalse, sizeof(bFalse) },<br />&nbsp; &nbsp; { CKA_GOSTR3410_PARAMS, paramsGostR3410, sizeof(paramsGostR3410) }, <br />&nbsp; &nbsp; { CKA_GOSTR3411_PARAMS, paramsGostR3411, sizeof(paramsGostR3411) } <br />&nbsp; };<br />&nbsp; CK_RV&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rv;</p><br /><p>&nbsp; if (CKR_OK != (rv = C_GenerateKeyPair( hSession<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; , &amp;genKeyMechanism<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; , pubKeyTemplate, arraysize(pubKeyTemplate)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; , privKeyTemplate, arraysize(privKeyTemplate)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; , &amp;hPublicKey, &amp;hPrivateKey)))<br />&nbsp; {<br />&nbsp; &nbsp; printf(&quot;Token can&#039;t generate key. Code %08X\n&quot;, rv);<br />&nbsp; }</p><br /><p>По факту ошибка 0xD1 (CKR_TEMPLATE_INCONSISTENT).<br />Что тут не так?</p><p>PS. На более свежем Hardware version v20.5 / Firnware version v23.2 все работает. Как узнать/понять, где что можно, а где нет?</p>]]></content>
			<author>
				<name><![CDATA[crazy_blu]]></name>
				<uri>https://forum.rutoken.ru/user/9574/</uri>
			</author>
			<updated>2019-07-15T15:56:17Z</updated>
			<id>https://forum.rutoken.ru/post/13076/#p13076</id>
		</entry>
</feed>
