{"id":85822,"date":"2020-06-19T13:42:20","date_gmt":"2020-06-19T11:42:20","guid":{"rendered":"https:\/\/prohoster.info\/blog\/administrirovanie\/opyt-primeneniya-tehnologii-rutoken-dlya-registraczii-i-avtorizaczii-polzovatelej-v-sisteme-chast-3"},"modified":"2020-06-19T13:42:20","modified_gmt":"2020-06-19T11:42:20","slug":"opyt-primeneniya-tehnologii-rutoken-dlya-registraczii-i-avtorizaczii-polzovatelej-v-sisteme-chast-3","status":"publish","type":"post","link":"https:\/\/prohoster.info\/fr\/blog\/administrirovanie\/opyt-primeneniya-tehnologii-rutoken-dlya-registraczii-i-avtorizaczii-polzovatelej-v-sisteme-chast-3","title":{"rendered":"Exp\u00e9rience d'application de la technologie Rutoken pour l'enregistrement et l'autorisation des utilisateurs dans le syst\u00e8me (partie 3)","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Bonjour !<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/506726\/\">Dans la partie pr\u00e9c\u00e9dente<\/a><\/noindex> Nous avons r\u00e9ussi \u00e0 cr\u00e9er notre propre autorit\u00e9 de certification. \u00c0 quoi cela peut-il \u00eatre utile pour nos besoins ? <\/p>\n<p>Avec une autorit\u00e9 de certification locale, nous pouvons d\u00e9livrer des certificats et v\u00e9rifier les signatures de ces certificats. <br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nLors de la d\u00e9livrance d'un certificat \u00e0 un utilisateur, l'autorit\u00e9 de certification utilise une demande sp\u00e9ciale de d\u00e9livrance de certificat Pkcs#10, ayant le format de fichier '.csr'. Cette demande contient une s\u00e9quence cod\u00e9e que l'autorit\u00e9 de certification sait comment analyser correctement. La demande contient \u00e0 la fois la cl\u00e9 publique de l'utilisateur et des donn\u00e9es pour cr\u00e9er le certificat (un tableau associatif avec des informations sur l'utilisateur). <\/p>\n<p>La mani\u00e8re d'obtenir une demande de d\u00e9livrance de certificat sera examin\u00e9e dans l'article suivant, mais ici je souhaite pr\u00e9senter les commandes principales de l'autorit\u00e9 de certification qui nous aideront \u00e0 accomplir notre t\u00e2che c\u00f4t\u00e9 backend. <\/p>\n<p>Tout d'abord, nous devons cr\u00e9er un certificat. Pour cela, utilisons la commande :<\/p>\n<pre><code class=\"plaintext\">openssl ca -batch -in user.csr -out user.crt<\/code><\/pre>\n<p>\nca \u2014 commande OpenSSL qui est li\u00e9e \u00e0 l'autorit\u00e9 de certification,<br \/>\n-batch \u2014 \u00e9vite les demandes de confirmation lors de la cr\u00e9ation du certificat.<br \/>\nuser.csr \u2014 demande de cr\u00e9ation de certificat (fichier au format .csr).<br \/>\nuser.crt \u2014 certificat (r\u00e9sultat obtenu de la commande).<\/p>\n<p>Pour que cette commande fonctionne, l'autorit\u00e9 de certification doit \u00eatre configur\u00e9e exactement comme d\u00e9crit <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/506726\/\">dans la partie pr\u00e9c\u00e9dente de l'article<\/a><\/noindex>. Sinon, il faudra sp\u00e9cifier en plus l'emplacement du certificat racine de l'autorit\u00e9 de certification. <\/p>\n<p>Commande de v\u00e9rification du certificat :<\/p>\n<pre><code class=\"plaintext\">openssl cms -verify -in authenticate.cms -inform PEM -CAfile \/Users\/\u2026\u2026\/demoCA\/ca.crt -out data.file<\/code><\/pre>\n<p>\ncms \u2014 commande OpenSSL utilis\u00e9e pour la signature, la v\u00e9rification, le chiffrement de donn\u00e9es et d'autres op\u00e9rations cryptographiques avec OpenSSL.<\/p>\n<p>-verify \u2014 dans ce cas, nous effectuons la v\u00e9rification du certificat.<\/p>\n<p>authenticate.cms \u2014 fichier contenant les donn\u00e9es sign\u00e9es par le certificat d\u00e9livr\u00e9 par la commande pr\u00e9c\u00e9dente.<\/p>\n<p>-inform PEM \u2014 utilis\u00e9 pour le format PEM.<\/p>\n<p>-CAfile \/Users\/\u2026\u2026\/demoCA\/ca.crt \u2014 chemin vers le certificat racine. (sans cela, ma commande n'a pas fonctionn\u00e9, m\u00eame si les chemins vers ca.crt sont indiqu\u00e9s dans le fichier openssl.cfg)<\/p>\n<p>-out data.file \u2014 les donn\u00e9es d\u00e9chiffr\u00e9es sont envoy\u00e9es dans le fichier data.file.<\/p>\n<p>L'algorithme d'application de l'autorit\u00e9 de certification c\u00f4t\u00e9 backend est le suivant :<\/p>\n<ul>\n<li>Enregistrement de l'utilisateur : \n<ol>\n<li>Nous recevons une demande de cr\u00e9ation de certificat et l'enregistrons dans le fichier user.csr.\n <\/li>\n<li>Nous sauvegardons la premi\u00e8re commande de cet article dans un fichier avec l'extension .bat ou .cmd. Nous ex\u00e9cutons ce fichier depuis le code, apr\u00e8s avoir enregistr\u00e9 la demande de cr\u00e9ation de certificat dans le fichier user.csr. Nous obtenons le fichier de certificat user.crt.\n <\/li>\n<li>Nous lisons le fichier user.crt et l'envoyons au client. \n <\/li>\n<\/ol>\n<p>\n <\/li>\n<li>Autorisation de l'utilisateur : \n<ol>\n<li>Nous recevons les donn\u00e9es sign\u00e9es du client et les enregistrons dans le fichier authenticate.cms. <\/li>\n<li>Nous sauvegardons la deuxi\u00e8me commande de cet article dans un fichier avec l'extension .bat ou .cmd. Nous ex\u00e9cutons ce fichier depuis le code, apr\u00e8s avoir enregistr\u00e9 les donn\u00e9es sign\u00e9es depuis le serveur dans authenticate.cms. Nous obtenons le fichier avec les donn\u00e9es d\u00e9chiffr\u00e9es data.file.<\/li>\n<li>Nous lisons data.file et v\u00e9rifions la validit\u00e9 de ces donn\u00e9es. Ce qui doit \u00eatre v\u00e9rifi\u00e9 est d\u00e9crit <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/506450\/\">dans le premier article<\/a><\/noindex>. Si les donn\u00e9es sont valides, l'autorisation de l'utilisateur est consid\u00e9r\u00e9e comme r\u00e9ussie.<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p>\nPour mettre en \u0153uvre ces algorithmes, on peut utiliser n'importe quel langage de programmation utilis\u00e9 pour \u00e9crire le backend. <\/p>\n<p>Dans le prochain article, nous allons explorer comment travailler avec le plugin Rutoken.<\/p>\n<p>Merci de votre attention !<br \/>\n<br \/>Source : <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/507166\/\">habr.com<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c! \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0438\u0439 \u0446\u0435\u043d\u0442\u0440. \u0427\u0435\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u0435\u043d? \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0435\u0433\u043e \u0446\u0435\u043d\u0442\u0440\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0432\u044b\u0434\u0430\u0447\u0443 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043f\u043e \u044d\u0442\u0438\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430\u043c. \u041f\u0440\u0438 \u0432\u044b\u0434\u0430\u0447\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0438\u0439 \u0446\u0435\u043d\u0442\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0432\u044b\u0434\u0430\u0447\u0443 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 Pkcs#10, \u0438\u043c\u0435\u044e\u0449\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u0430 \u2018.csr\u2019. [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-85822","post","type-post","status-publish","format-standard","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c! \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0438\u0439 \u0446\u0435\u043d\u0442\u0440.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/fr\/blog\/administrirovanie\/opyt-primeneniya-tehnologii-rutoken-dlya-registraczii-i-avtorizaczii-polzovatelej-v-sisteme-chast-3\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"fr_FR\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u041e\u043f\u044b\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0420\u0443\u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 (\u0447\u0430\u0441\u0442\u044c 3) | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c! \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0438\u0439 \u0446\u0435\u043d\u0442\u0440.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/fr\/blog\/administrirovanie\/opyt-primeneniya-tehnologii-rutoken-dlya-registraczii-i-avtorizaczii-polzovatelej-v-sisteme-chast-3\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-06-19T11:42:20+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-06-19T11:42:20+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Exp\u00e9rience d'application de la technologie Rutoken pour l'enregistrement et l'autorisation des utilisateurs dans le syst\u00e8me (partie 3) | ProHoster","description":"Bonjour ! Dans la partie pr\u00e9c\u00e9dente, nous avons r\u00e9ussi \u00e0 cr\u00e9er notre autorit\u00e9 de certification.","canonical_url":"https:\/\/prohoster.info\/fr\/blog\/administrirovanie\/opyt-primeneniya-tehnologii-rutoken-dlya-registraczii-i-avtorizaczii-polzovatelej-v-sisteme-chast-3","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"fr_FR","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u041e\u043f\u044b\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0420\u0443\u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 (\u0447\u0430\u0441\u0442\u044c 3) | ProHoster","og:description":"\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c! \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0438\u0439 \u0446\u0435\u043d\u0442\u0440.","og:url":"https:\/\/prohoster.info\/fr\/blog\/administrirovanie\/opyt-primeneniya-tehnologii-rutoken-dlya-registraczii-i-avtorizaczii-polzovatelej-v-sisteme-chast-3","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-06-19T11:42:20+00:00","article:modified_time":"2020-06-19T11:42:20+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"85822","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 14:29:23","updated":"2022-09-30 17:41:02","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/fr\/wp-json\/wp\/v2\/posts\/85822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/fr\/wp-json\/wp\/v2\/comments?post=85822"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/fr\/wp-json\/wp\/v2\/posts\/85822\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/fr\/wp-json\/wp\/v2\/media?parent=85822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/fr\/wp-json\/wp\/v2\/categories?post=85822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/fr\/wp-json\/wp\/v2\/tags?post=85822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}