<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум Рутокен &mdash; Запрос на выпуск сертификата в формате RFC2797]]></title>
	<link rel="self" href="https://forum.rutoken.ru/feed/atom/topic/3138" />
	<updated>2020-03-16T15:22:32Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.rutoken.ru/topic/3138/</id>
		<entry>
			<title type="html"><![CDATA[Re: Запрос на выпуск сертификата в формате RFC2797]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/13998/#p13998" />
			<content type="html"><![CDATA[<p><strong>amarinskikh</strong>, ответили вам эл. почту.</p>]]></content>
			<author>
				<name><![CDATA[Павел Анфимов]]></name>
				<uri>https://forum.rutoken.ru/user/7338/</uri>
			</author>
			<updated>2020-03-16T15:22:32Z</updated>
			<id>https://forum.rutoken.ru/post/13998/#p13998</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Запрос на выпуск сертификата в формате RFC2797]]></title>
			<link rel="alternate" href="https://forum.rutoken.ru/post/13997/#p13997" />
			<content type="html"><![CDATA[<p>Мы используем, Рутокен ЭЦП 2.0 и Рутокен Плагин версии 4.5.0 + Модуль для Рутокен плагин версии 1.0.8 для интеграции в веб приложение.</p><p>Возникла проблема формат сгенерированого запроса на перевыпуск сертификата - он не соответствует требованиям УЦ.<br />УЦ требует чтобы запрос на перевыпуск сертификата был подписан ранее выпущенным сертификатом и был в формате RFC2797.<br />Генерируем запрос мы следующим образом</p><p>async function generateCSR(deviceId, oldCertId) {</p><p>&nbsp; &nbsp; const keyPairOptions = {<br />&nbsp; &nbsp; &nbsp; &nbsp; paramset: &quot;A&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; signatureSize: 512,<br />&nbsp; &nbsp; &nbsp; &nbsp; publicKeyAlgorithm: 2<br />&nbsp; &nbsp; };<br />&nbsp; &nbsp; const keypairId = await plugin.generateKeyPair(deviceId, null, null, keyPairOptions);</p><p>&nbsp; &nbsp; const generateCSROptions =&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br />&nbsp; &nbsp; &nbsp; &nbsp; hashAlgorithm: 2,<br />&nbsp; &nbsp; &nbsp; &nbsp; customExtensions: [],<br />&nbsp; &nbsp; &nbsp; &nbsp; subjectSignTool: &quot;СКЗИ РУТОКЕН ЭЦП&quot;<br />&nbsp; &nbsp; };<br />&nbsp; &nbsp; const x509Subject = [<br />&nbsp; &nbsp; &nbsp; &nbsp; { rdn: &quot;&quot;, value: &quot;&quot; }<br />&nbsp; &nbsp; ];<br />&nbsp; &nbsp; const extentions = {<br />&nbsp; &nbsp; &nbsp; &nbsp; keyUsage: [],<br />&nbsp; &nbsp; &nbsp; &nbsp; extKeyUsage: [],<br />&nbsp; &nbsp; &nbsp; &nbsp; certificatePolicies: []<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; let pkcs10 = await plugin.createPkcs10(deviceId, keypairId, x509Subject, extentions, generateCSROptions);</p><p>&nbsp; &nbsp; pkcs10 = pkcs10.replace(/(\-+BEGIN CERTIFICATE REQUEST\-+(\r\n?|\n))|((\r\n?|\n)\-+END CERTIFICATE REQUEST\-+)/g, &#039;&#039;);<br />&nbsp; &nbsp; const signingOptions = {<br />&nbsp; &nbsp; &nbsp; &nbsp; addUserCertificate: true,<br />&nbsp; &nbsp; &nbsp; &nbsp; useHardwareHash: true,<br />&nbsp; &nbsp; &nbsp; &nbsp; addSignTime: true<br />&nbsp; &nbsp; };</p><p>&nbsp; &nbsp; const pkcs7 = await plugin.sign(deviceId, oldCertId, pkcs10, true, signingOptions)<br />&nbsp; &nbsp; return pkcs7;<br />}</p><br /><p>В требованиях УЦ указано, что contentType должен быть id-cct-PKIData. В запросе сгенерированном нами pkcs7-data <span class="postimg"><a class="fancybox fancybox.image" rel="group" href="https://forum.rutoken.ru/uploads/images/2020/03/0137cacb3a31842fd37f7deb37de0fc0.jpg"><img class="fb_img" src="https://forum.rutoken.ru/uploads/previews/2020/03/0137cacb3a31842fd37f7deb37de0fc0.jpg" alt="" /></a></span> <br /> В эталонном запросе, удовлетворяющем требованиям УЦ -&nbsp; id-cct-PKIData&nbsp; <span class="postimg"><a class="fancybox fancybox.image" rel="group" href="https://forum.rutoken.ru/uploads/images/2020/03/0fc0a7472928797d1a7710b61cc89553.jpg"><img class="fb_img" src="https://forum.rutoken.ru/uploads/previews/2020/03/0fc0a7472928797d1a7710b61cc89553.jpg" alt="" /></a></span> </p><br /><p>Просим вас помочь нам разобраться в процедуре генерации запроса, что стоит сделать чтобы достичь требований УЦ</p>]]></content>
			<author>
				<name><![CDATA[amarinskikh]]></name>
				<uri>https://forum.rutoken.ru/user/11398/</uri>
			</author>
			<updated>2020-03-16T11:31:34Z</updated>
			<id>https://forum.rutoken.ru/post/13997/#p13997</id>
		</entry>
</feed>
