<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум Рутокен &mdash; Ошибка(10) при вызове C_CreateObject с атрибутом CKA_MODIFIABLE]]></title>
	<link rel="self" href="https://forum.rutoken.ru/feed/atom/topic/2668/" />
	<updated>2017-08-02T08:23:44Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.rutoken.ru/topic/2668/</id>
		<entry>
			<title type="html"><![CDATA[Re: Ошибка(10) при вызове C_CreateObject с атрибутом CKA_MODIFIABLE]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/11085/#p11085" />
			<content type="html"><![CDATA[<p>Добрый день, <strong>konkov</strong>.</p><p>Сделать в явном виде так как Вы хотите не получится.<br />Но Вы можете отдельно создать ключи и сертификат. Затем импортировать сертификат на токен установив certificateType в CERT_CATEGORY_CA. Тогда этот сертификат нельзя будет изменить, а внутри него будет лежать Ваш открытый ключ.</p>]]></content>
			<author>
				<name><![CDATA[Владимир Салыкин]]></name>
				<uri>https://forum.rutoken.ru/user/10195/</uri>
			</author>
			<updated>2017-08-02T08:23:44Z</updated>
			<id>https://forum.rutoken.ru/post/11085/#p11085</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Ошибка(10) при вызове C_CreateObject с атрибутом CKA_MODIFIABLE]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/11075/#p11075" />
			<content type="html"><![CDATA[<p>Хочу создать на токене открытый ключ(без закрытого) и запретить его модифицировать.</p>]]></content>
			<author>
				<name><![CDATA[konkov]]></name>
				<uri>https://forum.rutoken.ru/user/10736/</uri>
			</author>
			<updated>2017-07-27T08:00:18Z</updated>
			<id>https://forum.rutoken.ru/post/11075/#p11075</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Ошибка(10) при вызове C_CreateObject с атрибутом CKA_MODIFIABLE]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/11072/#p11072" />
			<content type="html"><![CDATA[<p>Добрый день, <strong>konkov</strong>.</p><p>Токен проверяет, что открытый и закрытый ключ соответствуют друг другу. CKA_MODIFIABLE подразумевает, что Вы сможете изменить открытый ключ отдельно от закрытого, что может привести к дальнейшим ошибкам при работе. Если вы хотите целиком изменить пару - то Вы можете просто удалить старую и импортировать\сгенерировать новую.</p><p>Расскажите какой сценарий работы вы хотите создать?</p>]]></content>
			<author>
				<name><![CDATA[Владимир Салыкин]]></name>
				<uri>https://forum.rutoken.ru/user/10195/</uri>
			</author>
			<updated>2017-07-26T11:59:52Z</updated>
			<id>https://forum.rutoken.ru/post/11072/#p11072</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Ошибка(10) при вызове C_CreateObject с атрибутом CKA_MODIFIABLE]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/11068/#p11068" />
			<content type="html"><![CDATA[<p>При вызове C_CreateObject с нижеследующим набором атрибутов получаем CKR_ATTRIBUTE_READ_ONLY(0x00000010)</p><p>char label[64];<br />int label_len = ...;<br />const char *userid = ...;<br />unsigned char *modulus = ...;<br />int modSize = ...;<br />nsigned char *exponent = ...;<br />int expSize = ...;</p><p>CK_BBOOL bFalse = 0;<br />CK_BBOOL bTrue = 1;<br />CK_KEY_TYPE key_type = CKK_RSA;<br />CK_OBJECT_CLASS class_public_key = CKO_PUBLIC_KEY;<br />CK_OBJECT_HANDLE public_key;<br />...<br />&nbsp; &nbsp; CK_ATTRIBUTE public_key_template[] = {<br />&nbsp; &nbsp; &nbsp; &nbsp; { CKA_CLASS, &amp;class_public_key, sizeof(class_public_key) }, <br />&nbsp; &nbsp; &nbsp; &nbsp; { CKA_KEY_TYPE, &amp;key_type, sizeof(key_type) },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; { CKA_ID, label, label_len },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; { CKA_SUBJECT, (void *)userid, strlen(userid) },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; { CKA_LABEL, label, label_len },<br />&nbsp; &nbsp; &nbsp; &nbsp; { CKA_TOKEN, &amp;bTrue, sizeof(bTrue) },<br />&nbsp; &nbsp; &nbsp; &nbsp; { CKA_PRIVATE, &amp;bFalse, sizeof(bFalse) },<br />&nbsp; &nbsp; &nbsp; &nbsp; { CKA_MODULUS, modulus, modSize },<br />&nbsp; &nbsp; &nbsp; &nbsp; { CKA_PUBLIC_EXPONENT, exponent, expSize },<br />&nbsp; &nbsp; &nbsp; &nbsp; { CKA_MODIFIABLE, &amp;bFalse, sizeof(bFalse) }<br />&nbsp; &nbsp; };<br />...<br />PKCS11_call-&gt;C_CreateObject(session, public_key_template, arraysize(public_key_template), &amp;public_key);</p><p>Если убрать CKA_MODIFIABLE - открытый ключ создается успешно.</p><p>Пробовали на<br />Windows 7 x64 SP1, Windows 7 x32 sp1, Windows XP sp3<br />rtPKCS11.dll 4.2.3.0<br />Rutoken фолетовый (Рутокен ЭЦП PKI) D 64K120Z</p>]]></content>
			<author>
				<name><![CDATA[konkov]]></name>
				<uri>https://forum.rutoken.ru/user/10736/</uri>
			</author>
			<updated>2017-07-25T12:42:10Z</updated>
			<id>https://forum.rutoken.ru/post/11068/#p11068</id>
		</entry>
</feed>
