{"id":346575,"date":"2023-03-10T21:01:40","date_gmt":"2023-03-10T21:01:40","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=346575"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2023-03-10T21:01:40","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=346575","title":{"rendered":"<span>API \u0427\u0435\u0441\u0442\u043d\u044b\u0439 \u0437\u043d\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043b\u044e\u0447 \u0441\u0435\u0441\u0441\u0438\u0438<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, habr!<\/p>\n<p>\u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u00ab\u0427\u0435\u0441\u0442\u043d\u044b\u0439 \u0417\u043d\u0430\u043a\u00bb (\u0427\u0417) \/ \u041c\u0414\u041b\u041f (\u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u043b\u0435\u043a\u0430\u0440\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u043f\u0430\u0440\u0430\u0442\u043e\u0432), \u0432 \u0447\u0430\u0441\u0442\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>\u041d\u0435 \u0440\u0430\u0437 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043d\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u044d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0434\u043e\u0441\u0442\u043e\u0439\u043d\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e \u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0433\u0430\u0439\u0434\u043e\u0432 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435, \u0445\u043e\u0442\u044f \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0432 \u0431\u0438\u0437\u043d\u0435\u0441\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0448\u0438\u0440\u043e\u043a\u043e \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d \u2013 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0442\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430: \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u0432 \u0427\u0417 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u0435\u0434\u0438\u043d\u0438\u0446 \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u044e\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043b\u0438\u0446\u0430\u043c\u0438, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0434\u0430\u0436 \u0441 \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438, \u0438 \u0442\u043f.)<\/p>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u00ab\u0427\u0435\u0441\u0442\u043d\u044b\u0439 \u0437\u043d\u0430\u043a\u00bb, \u0438 \u043a\u0430\u043a\u043e\u0432\u044b \u043e\u0441\u043d\u043e\u0432\u044b \u0435\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u2013 \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u043e\u0441\u043d\u043e\u0432\u044b \u0432\u0430\u043c \u0443\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b. <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443\u2026<\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f:<\/p>\n<ol>\n<li>\n<p>\u041a\u0420\u0418\u041f\u0422\u041e\u0413\u0420\u0410\u0424\u0418\u0427\u0415\u0421\u041a\u041e\u0415 \u041f\u041e &#8212; \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#8212; \u00a0\u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e. \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b:<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e CSP 5.0 \u0441\u0441\u044b\u043b\u043a\u0430 https:\/\/cryptopro.ru\/products\/csp<\/p>\n<\/li>\n<li>\n<p>\u043f\u043b\u0430\u0433\u0438\u043d \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u042d\u0426\u041f Browser plug-in \u0441\u0441\u044b\u043b\u043a\u0430 https:\/\/www.cryptopro.ru\/products\/cades\/plugin<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/chrome.google.com\/webstore\/detail\/cryptopro-extension-for-c\/iifchhfnnmpdbibifmljnfjhpififfog?hl=ru\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 CryptoPro Extension for CAdES Browser Plug-in <\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0432\u0441\u0435 \u043b\u0438 \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u043c\u043f\u0435 \u0427\u0417 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0443 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 <a href=\"https:\/\/markirovka.crpt.ru\/plugins\/cryptopro\" rel=\"noopener noreferrer nofollow\">https:\/\/markirovka.crpt.ru\/plugins\/cryptopro<\/a><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/17d\/459\/389\/17d459389b6f477d9e026a9fd0f18f99.jpg\" width=\"621\" height=\"414\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/17d\/459\/389\/17d459389b6f477d9e026a9fd0f18f99.jpg\" data-blurred=\"true\"\/><\/figure>\n<ol start=\"2\">\n<li>\n<p>\u0421\u0430\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u041a\u042d\u041f. \u0418 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u0430 \u0442\u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u0427\u0417. <\/p>\n<\/li>\n<li>\n<p>\u041d\u0443 \u0438 Python. \u0425\u043e\u0442\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u0432\u043e\u0435\u043c \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a com-\u041e\u0431\u044a\u0435\u043a\u0442\u0430\u043c \u0438 \u0445 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u0433\u0430\u0442\u044c \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0430\u043c \u043f\u043e \u0434\u0443\u0448\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u041a\u042d\u041f \u2013 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435, \u0447\u0435\u043c \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u041a\u042d\u041f \u0443\u0436\u0435 \u0435\u0441\u0442\u044c (\u043e\u043d\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f, \u0430 \u043e\u0442\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u043c\u0430\u044f, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0440\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0443\u0440). \u041f\u0440\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043b\u0438\u0447\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/105\/8f0\/f3e\/1058f0f3e16005e37d131ac1eb871cb0.jpg\" width=\"582\" height=\"623\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/105\/8f0\/f3e\/1058f0f3e16005e37d131ac1eb871cb0.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u0438 \u0432\u0441\u0435 \u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u044b, \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435 \u043b\u0438\u0448\u043d\u0438\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u0430\u0431\u0438\u043d\u0435\u0442 (\u041b\u041a) \u043d\u0430 \u0441\u0430\u0439\u0442\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0442\u0442\u0443\u0434\u0430 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0437\u044f\u0442\u044c \u043a\u0440\u0435\u0434\u044b \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 (https:\/\/mdlp.crpt.ru\/static\/document\/api_mdlp_ru.pdf) \u043a API \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e client_id, client_secret, user_id, \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u043c\u044b \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u041b\u041a \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2013 \u0423\u0447\u0435\u0442\u043d\u044b\u0435 \u0421\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/9d3\/3ff\/b8d\/9d33ffb8deb7b2342a387b828f78a35b.jpg\" width=\"407\" height=\"513\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9d3\/3ff\/b8d\/9d33ffb8deb7b2342a387b828f78a35b.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0442\u0430\u043a\u0436\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0438\u0439\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440, \u043e\u043d \u043d\u0430\u043c \u0442\u043e\u0436\u0435 \u0432\u0441\u043a\u043e\u0440\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443 &#8212; \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f. \u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u043e \u0447\u0443\u0434\u043e \u0432 3 \u044d\u0442\u0430\u043f\u0430. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u00ab\u043a\u043e\u0434 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438\u00bb \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u043c \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0427\u0417 \u0438 \u043f\u043e\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d.<\/p>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a API \u0427\u0417 \u043d\u0435\u0442 \u043d\u0438 \u0441\u043b\u043e\u0432\u0430 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u00ab\u043a\u043e\u0434 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438\u00bb.<\/p>\n<p>\u0422\u0443\u0442 \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0434\u0442\u0438 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043e\u0442 \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e <a href=\"https:\/\/docs.cryptopro.ru\/cades\/usage\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.cryptopro.ru\/cades\/usage<\/a><\/p>\n<p>\u0418 \u0442\u0430\u043a \u0435\u0441\u043b\u0438 \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Ubuntu \u0432\u0430\u043c \u043f\u043e\u0432\u0435\u0437\u043b\u043e \u0434\u043b\u044f \u0432\u0430\u0441 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u00ab\u0421\u0431\u043e\u0440\u043a\u0443 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u044f\u0437\u044b\u043a\u0430 Python\u00bb, \u0447\u0442\u043e \u0442\u0430\u043c \u043e\u043d\u0438 \u043d\u0430\u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438 \u043e\u043d\u043e \u044f \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b. \u041d\u0443 \u0430 \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0430 Windows \u0434\u0430\u043b\u0435\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0432\u0430\u0441. <\/p>\n<p>\u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043e\u0442 \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b \u00ab\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 COM\u00bb \u043e\u043d \u0442\u043e \u043d\u0430\u043c \u0438 \u043d\u0443\u0436\u0435\u043d \u0442\u0430\u043c \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0430 VBScript, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u043c \u043e\u0442\u0447\u0430\u0441\u0442\u0438. \u0414\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u043d\u0443\u0436\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b:<\/p>\n<ul>\n<li>\n<p>&#171;CAdESCOM.Store&#187; \u2013 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432 \u043f\u043e\u0438\u0441\u043a\u0435 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>&#171;CAdESCOM.CPSigner&#187; \u2013 \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>&#171;CAdESCOM.CPAttribute&#187; \u2013 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043a \u043f\u043e\u0434\u043f\u0438\u0441\u0438<\/p>\n<\/li>\n<li>\n<p>&#171;CAdESCOM.CadesSignedData&#187; \u2013 \u043e\u0431\u044a\u0435\u043a\u0442 \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 win32com, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 pywin32, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043b Mark Hammond \u0445\u0440\u0430\u043d\u0438 \u0435\u0433\u043e \u0413\u043e\u0441\u043f\u043e\u0434\u044c. \u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f: \u0434\u0435\u0440\u0436\u0438\u0442\u0435 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443\u00a0 Tim Golden <a href=\"http:\/\/timgolden.me.uk\/python\/\" rel=\"noopener noreferrer nofollow\">http:\/\/timgolden.me.uk\/python\/<\/a> \u043d\u0430 \u044d\u0442\u043e\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0435 \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python \u0432 Windows \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<p>\u0418 \u0442\u0430\u043a \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0438\u043b\u0438, \u043a\u0430\u043a \u043e\u043d \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0427\u0417, \u00ab\u041a\u043b\u044e\u0447 \u0441\u0435\u0441\u0441\u0438\u0438\u00bb<\/p>\n<ol>\n<li>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">import win32com.client import os, sys import json import datetime import base64<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">CADES_BES = 1 CADES_DEFAULT = 0 CAPICOM_ENCODE_BASE64 = 0 CAPICOM_CURRENT_USER_STORE = 2 CAPICOM_MY_STORE = 'My' CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u0418\u0449\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u0422\u0443\u0442 \u0442\u043e \u043d\u0430\u043c \u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c, \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439    \u0440\u0430\u043d\u0435\u0435, \u0441\u0435\u0440\u0438\u0439\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">oStore = win32com.client.Dispatch(\"CAdESCOM.Store\") oStore.Open(CAPICOM_CURRENT_USER_STORE, CAPICOM_MY_STORE, CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED) for val in oStore.Certificates:     if val.SerialNumber == sSerialNumber:         oCert = val oStore.Close <\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">oSigner = win32com.client.Dispatch(CAdESCOM.CPSigner\") oSigner.Certificate = oCert oSigningTimeAttr = win32com.client.Dispatch(\"CAdESCOM.CPAttribute\") oSigningTimeAttr.Name = 0 oSigningTimeAttr.Value = datetime.datetime.now() oSigner.AuthenticatedAttributes2.Add(oSigningTimeAttr)<\/code><\/pre>\n<ol start=\"5\">\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043e\u0434 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0430 \u0432\u043e\u0442 \u0442\u0443\u0442 \u0432\u0430\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0427\u0417 \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 requests, \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u044b \u043f\u043e\u0442\u0435\u0440\u044f\u043b\u0438 \u043d\u0435\u043c\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c COM \u043e\u0431\u044a\u0435\u043a\u0442\u044b Windows &#171;WinHTTP.WinHTTPRequest.5.1&#187;<\/p>\n<\/li>\n<\/ol>\n<pre><code>url = \"https:\/\/api.mdlp.crpt.ru\/api\/v1\/auth\"   params = {     'client_id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',     'client_secret':'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',     'user_id':'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',     'auth_type':'SIGNED_CODE'         }  win_http = win32com.client.Dispatch('WinHTTP.WinHTTPRequest.5.1') win_http.Open(\"POST\", url, False) win_http.SetRequestHeader(\"Content-Type\",\"application\/json;charset=UTF-8\") win_http.SetRequestHeader(\"Accept\",\"application\/json;charset=UTF-8\") win_http.Send(json.dumps(params)) win_http.WaitForResponse() print(win_http.ResponseText) items  = json.loads(win_http.ResponseText) CodeAuth = items['code']<\/code><\/pre>\n<ol start=\"6\">\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u0438 \u0435\u0451 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u0443 \u043d\u0430\u0441 \u0442\u043e\u0436\u0435 \u043e\u0442\u043d\u044f\u043b \u043d\u0435 \u043c\u0430\u043b\u043e \u0441\u0438\u043b \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044e \u043d\u0430\u0448\u0438 \u043e\u0448\u0438\u0431\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u0438\u0445 \u043d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043b\u0438: <\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0430\u043c \u043a\u043e\u0434, \u0430 \u043d\u0435 \u0432\u0435\u0441\u044c json, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u044b \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0434\u043f\u0438\u0448\u0435\u0442\u0435 \u0435\u0433\u043e, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432 \u043e\u0442\u0432\u0435\u0442 \u0440\u0430\u0437 \u0437\u0430 \u0440\u0430\u0437\u043e\u043c \u0432\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. <\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u0443\u0439\u0442\u0435 \u0432 base64 \u043a\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0418 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435<\/p>\n<\/li>\n<\/ul>\n<pre><code>oSignedData = win32com.client.Dispatch(\"CAdESCOM.CadesSignedData\") oSignedData.ContentEncoding = 1 message = CodeAuth message_bytes = message.encode('ascii') base64_bytes = base64.b64encode(message_bytes) base64_message = base64_bytes.decode('ascii') oSignedData.Content = base64_message sSignedData = oSignedData.SignCades(oSigner, CADES_BES, False, CAPICOM_ENCODE_BASE64)<\/code><\/pre>\n<ol start=\"7\">\n<li>\n<p>\u041d\u0443 \u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0433 &#8212; \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430 \u0441\u0435\u0441\u0441\u0438\u0438<\/p>\n<\/li>\n<\/ol>\n<pre><code>url = \"https:\/\/api.mdlp.crpt.ru\/api\/v1\/token\" paramskey ={   'code': CodeAuth,   'signature': sSignedData } print(json.dumps(paramskey)) win_http.Open(\"POST\", url, False) win_http.SetRequestHeader(\"Content-Type\",\"application\/json;charset=UTF-8\") win_http.SetRequestHeader(\"Accept\",\"application\/json;charset=UTF-8\") win_http.Send(json.dumps(paramskey)) win_http.WaitForResponse() print(win_http.ResponseText)<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438: <\/p>\n<p>{&#171;token&#187;:&#187;0d90d966-5027-416f-a0cd-0697db8c79f3&#8243;,&#187;life_time&#187;:600} <\/p>\n<p>&#8212; \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e, \u0432\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0432\u0441\u0435 \u0432\u0435\u0440\u043d\u043e!<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0446\u0435\u043b\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u0438 \u0427\u0417, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0442\u0435\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043d\u044f\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0415\u0441\u043b\u0438 \u0443 \u043a\u043e\u0433\u043e-\u0442\u043e \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u2013 \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. <\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/721622\/\"> https:\/\/habr.com\/ru\/post\/721622\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, habr!<\/p>\n<p>\u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u00ab\u0427\u0435\u0441\u0442\u043d\u044b\u0439 \u0417\u043d\u0430\u043a\u00bb (\u0427\u0417) \/ \u041c\u0414\u041b\u041f (\u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u043b\u0435\u043a\u0430\u0440\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u043f\u0430\u0440\u0430\u0442\u043e\u0432), \u0432 \u0447\u0430\u0441\u0442\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>\u041d\u0435 \u0440\u0430\u0437 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043d\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u044d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0434\u043e\u0441\u0442\u043e\u0439\u043d\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e \u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0433\u0430\u0439\u0434\u043e\u0432 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435, \u0445\u043e\u0442\u044f \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0432 \u0431\u0438\u0437\u043d\u0435\u0441\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0448\u0438\u0440\u043e\u043a\u043e \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d \u2013 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0442\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430: \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u0432 \u0427\u0417 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u0435\u0434\u0438\u043d\u0438\u0446 \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u044e\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043b\u0438\u0446\u0430\u043c\u0438, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0434\u0430\u0436 \u0441 \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438, \u0438 \u0442\u043f.)<\/p>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u00ab\u0427\u0435\u0441\u0442\u043d\u044b\u0439 \u0437\u043d\u0430\u043a\u00bb, \u0438 \u043a\u0430\u043a\u043e\u0432\u044b \u043e\u0441\u043d\u043e\u0432\u044b \u0435\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u2013 \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u043e\u0441\u043d\u043e\u0432\u044b \u0432\u0430\u043c \u0443\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b. <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443\u2026<\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f:<\/p>\n<ol>\n<li>\n<p>\u041a\u0420\u0418\u041f\u0422\u041e\u0413\u0420\u0410\u0424\u0418\u0427\u0415\u0421\u041a\u041e\u0415 \u041f\u041e &#8212; \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#8212; \u00a0\u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e. \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b:<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e CSP 5.0 \u0441\u0441\u044b\u043b\u043a\u0430 https:\/\/cryptopro.ru\/products\/csp<\/p>\n<\/li>\n<li>\n<p>\u043f\u043b\u0430\u0433\u0438\u043d \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u042d\u0426\u041f Browser plug-in \u0441\u0441\u044b\u043b\u043a\u0430 https:\/\/www.cryptopro.ru\/products\/cades\/plugin<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/chrome.google.com\/webstore\/detail\/cryptopro-extension-for-c\/iifchhfnnmpdbibifmljnfjhpififfog?hl=ru\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 CryptoPro Extension for CAdES Browser Plug-in <\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0432\u0441\u0435 \u043b\u0438 \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u043c\u043f\u0435 \u0427\u0417 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0443 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 <a href=\"https:\/\/markirovka.crpt.ru\/plugins\/cryptopro\" rel=\"noopener noreferrer nofollow\">https:\/\/markirovka.crpt.ru\/plugins\/cryptopro<\/a><\/p>\n<figure class=\"full-width\"><\/figure>\n<ol start=\"2\">\n<li>\n<p>\u0421\u0430\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u041a\u042d\u041f. \u0418 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u0430 \u0442\u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u0427\u0417. <\/p>\n<\/li>\n<li>\n<p>\u041d\u0443 \u0438 Python. \u0425\u043e\u0442\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u0432\u043e\u0435\u043c \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a com-\u041e\u0431\u044a\u0435\u043a\u0442\u0430\u043c \u0438 \u0445 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u0433\u0430\u0442\u044c \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0430\u043c \u043f\u043e \u0434\u0443\u0448\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u041a\u042d\u041f \u2013 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435, \u0447\u0435\u043c \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u041a\u042d\u041f \u0443\u0436\u0435 \u0435\u0441\u0442\u044c (\u043e\u043d\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f, \u0430 \u043e\u0442\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u043c\u0430\u044f, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0440\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0443\u0440). \u041f\u0440\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043b\u0438\u0447\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u0438 \u0432\u0441\u0435 \u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u044b, \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435 \u043b\u0438\u0448\u043d\u0438\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u0430\u0431\u0438\u043d\u0435\u0442 (\u041b\u041a) \u043d\u0430 \u0441\u0430\u0439\u0442\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0442\u0442\u0443\u0434\u0430 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0437\u044f\u0442\u044c \u043a\u0440\u0435\u0434\u044b \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 (https:\/\/mdlp.crpt.ru\/static\/document\/api_mdlp_ru.pdf) \u043a API \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e client_id, client_secret, user_id, \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u043c\u044b \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u041b\u041a \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2013 \u0423\u0447\u0435\u0442\u043d\u044b\u0435 \u0421\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0442\u0430\u043a\u0436\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0438\u0439\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440, \u043e\u043d \u043d\u0430\u043c \u0442\u043e\u0436\u0435 \u0432\u0441\u043a\u043e\u0440\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443 &#8212; \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f. \u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u043e \u0447\u0443\u0434\u043e \u0432 3 \u044d\u0442\u0430\u043f\u0430. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u00ab\u043a\u043e\u0434 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438\u00bb \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u043c \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0427\u0417 \u0438 \u043f\u043e\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d.<\/p>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a API \u0427\u0417 \u043d\u0435\u0442 \u043d\u0438 \u0441\u043b\u043e\u0432\u0430 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u00ab\u043a\u043e\u0434 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438\u00bb.<\/p>\n<p>\u0422\u0443\u0442 \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0434\u0442\u0438 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043e\u0442 \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e <a href=\"https:\/\/docs.cryptopro.ru\/cades\/usage\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.cryptopro.ru\/cades\/usage<\/a><\/p>\n<p>\u0418 \u0442\u0430\u043a \u0435\u0441\u043b\u0438 \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Ubuntu \u0432\u0430\u043c \u043f\u043e\u0432\u0435\u0437\u043b\u043e \u0434\u043b\u044f \u0432\u0430\u0441 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u00ab\u0421\u0431\u043e\u0440\u043a\u0443 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u044f\u0437\u044b\u043a\u0430 Python\u00bb, \u0447\u0442\u043e \u0442\u0430\u043c \u043e\u043d\u0438 \u043d\u0430\u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438 \u043e\u043d\u043e \u044f \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b. \u041d\u0443 \u0430 \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0430 Windows \u0434\u0430\u043b\u0435\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0432\u0430\u0441. <\/p>\n<p>\u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043e\u0442 \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b \u00ab\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 COM\u00bb \u043e\u043d \u0442\u043e \u043d\u0430\u043c \u0438 \u043d\u0443\u0436\u0435\u043d \u0442\u0430\u043c \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0430 VBScript, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u043c \u043e\u0442\u0447\u0430\u0441\u0442\u0438. \u0414\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u043d\u0443\u0436\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b:<\/p>\n<ul>\n<li>\n<p>&#171;CAdESCOM.Store&#187; \u2013 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432 \u043f\u043e\u0438\u0441\u043a\u0435 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>&#171;CAdESCOM.CPSigner&#187; \u2013 \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>&#171;CAdESCOM.CPAttribute&#187; \u2013 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043a \u043f\u043e\u0434\u043f\u0438\u0441\u0438<\/p>\n<\/li>\n<li>\n<p>&#171;CAdESCOM.CadesSignedData&#187; \u2013 \u043e\u0431\u044a\u0435\u043a\u0442 \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 win32com, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 pywin32, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043b Mark Hammond \u0445\u0440\u0430\u043d\u0438 \u0435\u0433\u043e \u0413\u043e\u0441\u043f\u043e\u0434\u044c. \u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f: \u0434\u0435\u0440\u0436\u0438\u0442\u0435 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443\u00a0 Tim Golden <a href=\"http:\/\/timgolden.me.uk\/python\/\" rel=\"noopener noreferrer nofollow\">http:\/\/timgolden.me.uk\/python\/<\/a> \u043d\u0430 \u044d\u0442\u043e\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0435 \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python \u0432 Windows \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<p>\u0418 \u0442\u0430\u043a \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0438\u043b\u0438, \u043a\u0430\u043a \u043e\u043d \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0427\u0417, \u00ab\u041a\u043b\u044e\u0447 \u0441\u0435\u0441\u0441\u0438\u0438\u00bb<\/p>\n<ol>\n<li>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">import win32com.client import os, sys import json import datetime import base64<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">CADES_BES = 1 CADES_DEFAULT = 0 CAPICOM_ENCODE_BASE64 = 0 CAPICOM_CURRENT_USER_STORE = 2 CAPICOM_MY_STORE = 'My' CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u0418\u0449\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u0422\u0443\u0442 \u0442\u043e \u043d\u0430\u043c \u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c, \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439    \u0440\u0430\u043d\u0435\u0435, \u0441\u0435\u0440\u0438\u0439\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">oStore = win32com.client.Dispatch(\"CAdESCOM.Store\") oStore.Open(CAPICOM_CURRENT_USER_STORE, CAPICOM_MY_STORE, CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED) for val in oStore.Certificates:     if val.SerialNumber == sSerialNumber:         oCert = val oStore.Close <\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">oSigner = win32com.client.Dispatch(CAdESCOM.CPSigner\") oSigner.Certificate = oCert oSigningTimeAttr = win32com.client.Dispatch(\"CAdESCOM.CPAttribute\") oSigningTimeAttr.Name = 0 oSigningTimeAttr.Value = datetime.datetime.now() oSigner.AuthenticatedAttributes2.Add(oSigningTimeAttr)<\/code><\/pre>\n<ol start=\"5\">\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043e\u0434 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0430 \u0432\u043e\u0442 \u0442\u0443\u0442 \u0432\u0430\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0427\u0417 \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 requests, \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u044b \u043f\u043e\u0442\u0435\u0440\u044f\u043b\u0438 \u043d\u0435\u043c\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c COM \u043e\u0431\u044a\u0435\u043a\u0442\u044b Windows &#171;WinHTTP.WinHTTPRequest.5.1&#187;<\/p>\n<\/li>\n<\/ol>\n<pre><code>url = \"https:\/\/api.mdlp.crpt.ru\/api\/v1\/auth\"   params = {     'client_id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',     'client_secret':'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',     'user_id':'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',     'auth_type':'SIGNED_CODE'         }  win_http = win32com.client.Dispatch('WinHTTP.WinHTTPRequest.5.1') win_http.Open(\"POST\", url, False) win_http.SetRequestHeader(\"Content-Type\",\"application\/json;charset=UTF-8\") win_http.SetRequestHeader(\"Accept\",\"application\/json;charset=UTF-8\") win_http.Send(json.dumps(params)) win_http.WaitForResponse() print(win_http.ResponseText) items  = json.loads(win_http.ResponseText) CodeAuth = items['code']<\/code><\/pre>\n<ol start=\"6\">\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u0438 \u0435\u0451 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u0443 \u043d\u0430\u0441 \u0442\u043e\u0436\u0435 \u043e\u0442\u043d\u044f\u043b \u043d\u0435 \u043c\u0430\u043b\u043e \u0441\u0438\u043b \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044e \u043d\u0430\u0448\u0438 \u043e\u0448\u0438\u0431\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u0438\u0445 \u043d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043b\u0438: <\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0430\u043c \u043a\u043e\u0434, \u0430 \u043d\u0435 \u0432\u0435\u0441\u044c json, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u044b \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0434\u043f\u0438\u0448\u0435\u0442\u0435 \u0435\u0433\u043e, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432 \u043e\u0442\u0432\u0435\u0442 \u0440\u0430\u0437 \u0437\u0430 \u0440\u0430\u0437\u043e\u043c \u0432\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. <\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u0443\u0439\u0442\u0435 \u0432 base64 \u043a\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0418 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435<\/p>\n<\/li>\n<\/ul>\n<pre><code>oSignedData = win32com.client.Dispatch(\"CAdESCOM.CadesSignedData\") oSignedData.ContentEncoding = 1 message = CodeAuth message_bytes = message.encode('ascii') base64_bytes = base64.b64encode(message_bytes) base64_message = base64_bytes.decode('ascii') oSignedData.Content = base64_message sSignedData = oSignedData.SignCades(oSigner, CADES_BES, False, CAPICOM_ENCODE_BASE64)<\/code><\/pre>\n<ol start=\"7\">\n<li>\n<p>\u041d\u0443 \u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0433 &#8212; \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430 \u0441\u0435\u0441\u0441\u0438\u0438<\/p>\n<\/li>\n<\/ol>\n<pre><code>url = \"https:\/\/api.mdlp.crpt.ru\/api\/v1\/token\" paramskey ={   'code': CodeAuth,   'signature': sSignedData } print(json.dumps(paramskey)) win_http.Open(\"POST\", url, False) win_http.SetRequestHeader(\"Content-Type\",\"application\/json;charset=UTF-8\") win_http.SetRequestHeader(\"Accept\",\"application\/json;charset=UTF-8\") win_http.Send(json.dumps(paramskey)) win_http.WaitForResponse() print(win_http.ResponseText)<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438: <\/p>\n<p>{&#171;token&#187;:&#187;0d90d966-5027-416f-a0cd-0697db8c79f3&#8243;,&#187;life_time&#187;:600} <\/p>\n<p>&#8212; \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e, \u0432\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0432\u0441\u0435 \u0432\u0435\u0440\u043d\u043e!<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0446\u0435\u043b\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u0438 \u0427\u0417, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0442\u0435\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043d\u044f\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0415\u0441\u043b\u0438 \u0443 \u043a\u043e\u0433\u043e-\u0442\u043e \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u2013 \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. <\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/721622\/\"> https:\/\/habr.com\/ru\/post\/721622\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-346575","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/346575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=346575"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/346575\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=346575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=346575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=346575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}