<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум Рутокен &mdash; Расшифровка открытым ключом и какая логика дожна быть]]></title>
	<link rel="self" href="https://forum.rutoken.ru/feed/atom/topic/3938" />
	<updated>2023-06-07T10:31:45Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.rutoken.ru/topic/3938/</id>
		<entry>
			<title type="html"><![CDATA[Re: Расшифровка открытым ключом и какая логика дожна быть]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/20786/#p20786" />
			<content type="html"><![CDATA[<p><strong>smartiska</strong>, добрый день.<br />Наши разработчики подготовили пример с проверкой CMS подписи <a href="https://github.com/AktivCo/rutoken-demoshift-ios/tree/cms-verify">https://github.com/AktivCo/rutoken-demo … cms-verify</a><br />На вход необходимо подать подписанные файлы, которые можно сделать в Демосмене, и сертификат пользователя.</p>]]></content>
			<author>
				<name><![CDATA[Аверченко Кирилл]]></name>
				<uri>https://forum.rutoken.ru/user/11551/</uri>
			</author>
			<updated>2023-06-07T10:31:45Z</updated>
			<id>https://forum.rutoken.ru/post/20786/#p20786</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Расшифровка открытым ключом и какая логика дожна быть]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/20771/#p20771" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Аверченко Кирилл пишет:</cite><blockquote><p>Да, для проверки подписи необходим только открытый ключ. Рутокен не обязателен.</p></blockquote></div><p>Вопрос все еще открыт:(</p>]]></content>
			<author>
				<name><![CDATA[smartiska]]></name>
				<uri>https://forum.rutoken.ru/user/13664/</uri>
			</author>
			<updated>2023-06-07T05:10:37Z</updated>
			<id>https://forum.rutoken.ru/post/20771/#p20771</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Расшифровка открытым ключом и какая логика дожна быть]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/20757/#p20757" />
			<content type="html"><![CDATA[<p><strong>Аверченко Кирилл</strong>, Добрый день, можете пожалуйста привести пример кода верификации подписи, с использованием только открытого ключа без рутокена. Никак не могу понять, как сделать это</p>]]></content>
			<author>
				<name><![CDATA[smartiska]]></name>
				<uri>https://forum.rutoken.ru/user/13664/</uri>
			</author>
			<updated>2023-06-06T09:15:18Z</updated>
			<id>https://forum.rutoken.ru/post/20757/#p20757</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Расшифровка открытым ключом и какая логика дожна быть]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/20708/#p20708" />
			<content type="html"><![CDATA[<p><strong>smartiska</strong>, добрый день.<br />1. Да, для проверки подписи необходим только открытый ключ. Рутокен не обязателен.<br />2. Это поле - электронная подпись сертификата ключем удостоверяющего центра. Если вы перед проверкой электронной подписи документа проверяете на валидность сертификат, то это поле используется.<br />Проверить эту подпись можно с помощью открытого ключа центра сертификации, который выдал ваш сертификат.</p>]]></content>
			<author>
				<name><![CDATA[Аверченко Кирилл]]></name>
				<uri>https://forum.rutoken.ru/user/11551/</uri>
			</author>
			<updated>2023-05-31T08:58:08Z</updated>
			<id>https://forum.rutoken.ru/post/20708/#p20708</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Расшифровка открытым ключом и какая логика дожна быть]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/20702/#p20702" />
			<content type="html"><![CDATA[<p><strong>Аверченко Кирилл</strong>, Здравствуйте, еще появились вопросы.<br />1. Можно ли узнать верна подпись или нет, без физического рутокена? (скорее всего с использованием публичного ключа)<br />2. Когда вызываю метод parseCertificate, в теле ответа есть поле Signature Value, мы как то или где то используем его?</p>]]></content>
			<author>
				<name><![CDATA[smartiska]]></name>
				<uri>https://forum.rutoken.ru/user/13664/</uri>
			</author>
			<updated>2023-05-30T13:33:20Z</updated>
			<id>https://forum.rutoken.ru/post/20702/#p20702</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Расшифровка открытым ключом и какая логика дожна быть]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/20684/#p20684" />
			<content type="html"><![CDATA[<p>Да, на выходе функции sign у вас как раз будет CMS конверт в кодировке base64.<br />Именно это вы передаете в функцию verify в поле signData.</p>]]></content>
			<author>
				<name><![CDATA[Аверченко Кирилл]]></name>
				<uri>https://forum.rutoken.ru/user/11551/</uri>
			</author>
			<updated>2023-05-29T09:08:22Z</updated>
			<id>https://forum.rutoken.ru/post/20684/#p20684</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Расшифровка открытым ключом и какая логика дожна быть]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/20683/#p20683" />
			<content type="html"><![CDATA[<p><strong>Аверченко Кирилл</strong>, И где я передаю cms в моем вызове метода verify, укажите плиз:)</p>]]></content>
			<author>
				<name><![CDATA[smartiska]]></name>
				<uri>https://forum.rutoken.ru/user/13664/</uri>
			</author>
			<updated>2023-05-29T08:17:53Z</updated>
			<id>https://forum.rutoken.ru/post/20683/#p20683</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Расшифровка открытым ключом и какая логика дожна быть]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/20682/#p20682" />
			<content type="html"><![CDATA[<p><strong>Аверченко Кирилл</strong>, Таак, понял, спасибо большое. У меня еще один общий вопрос остался. Я новичок в теме подписей, и не до конца могу понять. Получается строка которую нам возвращает sign - это и есть cms? Или при вызове каких методов, мы получаем в ответ cms?</p>]]></content>
			<author>
				<name><![CDATA[smartiska]]></name>
				<uri>https://forum.rutoken.ru/user/13664/</uri>
			</author>
			<updated>2023-05-29T08:14:04Z</updated>
			<id>https://forum.rutoken.ru/post/20682/#p20682</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Расшифровка открытым ключом и какая логика дожна быть]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/20677/#p20677" />
			<content type="html"><![CDATA[<p><strong>smartiska</strong>, добрый день.<br />При вызове sign с параметром addUserCertificate: true, сертификат (в котором содержится открытый ключ) кладется в CMS-конверт с подписью.</p><p>Соответственно, при вызове verify сертификат берется из CMS-конверта.</p>]]></content>
			<author>
				<name><![CDATA[Аверченко Кирилл]]></name>
				<uri>https://forum.rutoken.ru/user/11551/</uri>
			</author>
			<updated>2023-05-29T07:01:22Z</updated>
			<id>https://forum.rutoken.ru/post/20677/#p20677</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Расшифровка открытым ключом и какая логика дожна быть]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/20676/#p20676" />
			<content type="html"><![CDATA[<p><strong>Аверченко Кирилл</strong>, Метод sign выглядит следующим образом: </p><p>const tokenSign = () =&gt; {<br />&nbsp; &nbsp; return token().then(({ rutoken, devices }) =&gt; {<br />&nbsp; &nbsp; &nbsp; &nbsp; const device = devices[1];<br />&nbsp; &nbsp; &nbsp; &nbsp; console.log(rutoken);<br />&nbsp; &nbsp; &nbsp; &nbsp; return rutoken<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .login(device, &quot;123456&quot;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .then(() =&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rutoken.sign(device, certId, data, rutoken.DATA_FORMAT_BASE64, <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; detached: false,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addUserCertificate: true,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEssCert: false,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addSignTime: false,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; })<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );<br />&nbsp; &nbsp; });<br />};</p><br /><p>Метод verify: </p><p>const tokenVerify = (signData) =&gt; {<br />&nbsp; &nbsp; return token().then(({ rutoken, devices }) =&gt; {<br />&nbsp; &nbsp; &nbsp; &nbsp; console.log(devices)<br />&nbsp; &nbsp; &nbsp; &nbsp; const device = devices[0];<br />&nbsp; &nbsp; &nbsp; &nbsp; console.log(rutoken);<br />&nbsp; &nbsp; &nbsp; &nbsp; return rutoken.login(device, &quot;123456&quot;).then(() =&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rutoken.verify(device, signData, {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base64: true,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; verifyCertificate: false,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; })<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .then((res) =&gt; console.log(res))<br />&nbsp; &nbsp; &nbsp; &nbsp; );<br />&nbsp; &nbsp; });<br />};</p><p>Подпись идет одним рутокеном, проверка другим. Проверка возвращает true. Но не могу понять, куда передать открытый ключ подписываещго рутокена, в методе verify. Если есть примеры скиньте плиз, для наглядности)</p>]]></content>
			<author>
				<name><![CDATA[smartiska]]></name>
				<uri>https://forum.rutoken.ru/user/13664/</uri>
			</author>
			<updated>2023-05-29T06:36:47Z</updated>
			<id>https://forum.rutoken.ru/post/20676/#p20676</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Расшифровка открытым ключом и какая логика дожна быть]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/20669/#p20669" />
			<content type="html"><![CDATA[<p><strong>smartiska</strong>, добрый день.<br />Да, вы передаете вместе с подписанным сообщением свой открытый ключ.<br />На другой стороне проверяют подпись методом Verify с использованием вашего открытого ключа.</p>]]></content>
			<author>
				<name><![CDATA[Аверченко Кирилл]]></name>
				<uri>https://forum.rutoken.ru/user/11551/</uri>
			</author>
			<updated>2023-05-26T08:56:06Z</updated>
			<id>https://forum.rutoken.ru/post/20669/#p20669</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Расшифровка открытым ключом и какая логика дожна быть]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/20664/#p20664" />
			<content type="html"><![CDATA[<p>Имею рутокен ЭЦП 2.0, пишу веб приложение. Реализовал метод sign. Он возвращает base64 строку. Так же получил открытый ключ методом getPublicKeyValue. Так вот вопрос: как должна происходить логика дешифровки на другом компе? Типа передать ему открытый ключ который я получил и он каким то методом делает дешифровку или ему на его рутокен тоже надо установить такой же сертификат как мой?</p>]]></content>
			<author>
				<name><![CDATA[smartiska]]></name>
				<uri>https://forum.rutoken.ru/user/13664/</uri>
			</author>
			<updated>2023-05-26T05:34:05Z</updated>
			<id>https://forum.rutoken.ru/post/20664/#p20664</id>
		</entry>
</feed>
