{"id":333135,"date":"2022-05-15T15:00:49","date_gmt":"2022-05-15T15:00:49","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=333135"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=333135","title":{"rendered":"<span>\u041a\u0430\u043a \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c openssl \u0438 powershell, \u0438\u043b\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 RSA \u0434\u043b\u044f \u0441\u0430\u043c\u044b\u0445 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445<\/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>\u0412 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0434\u0435\u043d\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0442\u0443\u0445.<\/p>\n<p>\u041d\u0443 \u043f\u0440\u043e\u0442\u0443\u0445 \u0438 \u043f\u0440\u043e\u0442\u0443\u0445, \u0441\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f. \u0423 \u043d\u0430\u0441 \u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442! \u0429\u0430\u0441 \u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043f\u0438\u0448\u0435\u043c, \u0438 \u0432\u0441\u0451 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0438 \u043d\u0435\u0442. \u0423 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 &#8212; \u043d\u043e\u0432\u0430\u044f \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u0434\u043e\u0432\u0435\u0440\u0438\u044f, \u0430 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u0443\u0434\u0430 \u043c\u044b \u0441\u0442\u0430\u0432\u0438\u043c\u0441\u044f \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u043e\u0442 (\u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0432\u0435\u0441\u044c\u043c\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e) CA \u0432 \u0441\u0432\u043e\u0451 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432.<\/p>\n<p>\u041d\u043e \u043e\u043d\u0438 \u0433\u043e\u0442\u043e\u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 powershell, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c, \u0430 \u043f\u043e\u0442\u043e\u043c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0435\u0439. \u0414\u0430 \u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0431\u044b\u0442\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0448 \u043a\u043e\u0434. \u0410 \u043f\u0430\u043a\u0443\u0435\u043c \u043c\u044b \u043a\u043e\u0434 \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e powershell \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u0438\u0437\u043e\u0432\u0451\u043c \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e, \u0438 \u043d\u0430\u0431\u044c\u0451\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0448\u0438\u0448\u0435\u043a.<\/p>\n<hr\/>\n<details class=\"spoiler\">\n<summary>\u041f\u0430\u0440\u0430 \u0441\u043b\u043e\u0432 \u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p>\u041d\u0435 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0439\u0442\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e. \u0415\u0451 \u0441\u043b\u043e\u043c\u0430\u044e\u0442.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0439\u0442\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438. \u042d\u0442\u043e \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u0448\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c\u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u043a\u0440\u0438\u043f\u0442\u043e\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b. \u0412\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0414\u043b\u044f \u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u0442\u0435\u0440\u043f\u0435\u043b\u0438\u0432\u044b\u0445, \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439, \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 openssl:<\/p>\n<pre><code class=\"bash\">openssl genrsa -out private.pem 4096 openssl rsa -in private.pem -pubout -out public.pem sha512sum artifact.zip | cut -f 1 -d\\  | xxd -r -p | \\     openssl dgst -sign .\/private.pem \\       -sigopt rsa_padding_mode:pkcs1 -sha512 > signature sha512sum artifact.zip | cut -f 1 -d\\  | xxd -r -p | \\     openssl dgst -verify .\/public.pem -signature signature       -sigopt rsa_padding_mode:pkcs1 -sha512<\/code><\/pre>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043a\u043b\u044e\u0447\u0435\u0439, \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432 PowerShell:<\/p>\n<pre><code class=\"powershell\">$hash=Get-FileHash -Path artifact.zip -Algorithm SHA512 $bytehash=[byte[]]($hash.Hash -replace '..','0x$&amp;,' -split ',' -ne '') $rsa = [System.Security.Cryptography.RSA]::Create() $len=0  $prifile = Get-Content -Path .\/private.pem $prikey = $prifile -Split '`n' | Select-String -Pattern \"---\" -NotMatch | Join-String $prider = [System.Convert]::FromBase64String($prikey) $rsa.ImportRSAPrivateKey($prider, [ref] $len) $sig = $rsa.SignData($bytehash,     [System.Security.Cryptography.HashAlgorithmName]::SHA512,     [System.Security.Cryptography.RSASignaturePadding]::Pkcs1)  $pubfile = Get-Content -Path .\/public.pem $pubkey = $pubfile -Split '`n' | Select-String -Pattern \"---\" -NotMatch | Join-String $pubder = [System.Convert]::FromBase64String($pubkey) $rsa.ImportSubjectPublicKeyInfo($pubder, [ref] $len) $rsa.VerifyData($bytehash, $sig,     [System.Security.Cryptography.HashAlgorithmName]::SHA512,     [System.Security.Cryptography.RSASignaturePadding]::Pkcs1)<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u0414\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u044c<\/h2>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u043c\u044b\u0439 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442 \u0438 \u0440\u0430\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u0441 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u043c. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <a href=\"https:\/\/www.openssl.org\/docs\/manmaster\/man1\/openssl.html\" rel=\"noopener noreferrer nofollow\">openssl<\/a> \u0438 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/RSA\" rel=\"noopener noreferrer nofollow\">RSA<\/a> &#8212; \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c.<\/p>\n<p>\u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0441 \u0432 openssl \u0435\u0441\u0442\u044c \u0431\u043b\u043e\u043a \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 &#171;\u043d\u0438\u0437\u043a\u043e\u0433\u043e&#187; \u0443\u0440\u043e\u0432\u043d\u044f &#8212; <a href=\"https:\/\/www.openssl.org\/docs\/man1.1.1\/man1\/openssl-pkeyutl.html\" rel=\"noopener noreferrer nofollow\">pkeyutl<\/a><\/p>\n<pre><code class=\"bash\"># \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0438, \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 openssl genrsa -out private.pem 4096 openssl rsa -in private.pem -pubout -out public.pem # \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0430\u0439\u043b openssl pkeyutl -sign -inkey .\/private.pem -in artifact.zip #> Public Key operation error #> 140052316043152:error:0406C06E:rsa routines:RSA_padding_add_PKCS1_type_1:data too large for key size:rsa_pk1.c:75:<\/code><\/pre>\n<p>\u041e\u043e\u043f\u0441! \u041d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442&#8230;<\/p>\n<p>RSA \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043b\u044e\u0447\u0430 \u043c\u0438\u043d\u0443\u0441 <a href=\"https:\/\/medium.com\/@bn121rajesh\/rsa-sign-and-verify-using-openssl-behind-the-scene-bf3cac0aade2\" rel=\"noopener noreferrer nofollow\">\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a<\/a>.<\/p>\n<p>\u041d\u0443 \u0434\u0430 \u043b\u0430\u0434\u043d\u043e, \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0442\u044c. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 &#8212; \u0437\u0430\u0445\u0435\u0448\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b. \u041a\u043b\u044e\u0447 \u0443 \u043d\u0430\u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u043e\u0437\u044c\u043c\u0451\u043c <a href=\"https:\/\/man7.org\/linux\/man-pages\/man1\/sha512sum.1.html\" rel=\"noopener noreferrer nofollow\">SHA512<\/a>:<\/p>\n<pre><code class=\"bash\"># \u041f\u043e\u043f\u044b\u0442\u043a\u0430 1 # \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u0445\u043b\u043e\u043f sha512sum sha512sum artifact.zip | openssl pkeyutl -sign -inkey .\/private.pem > signature # \u0438 \u0442\u0443\u0442 \u0436\u0435 \u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c sha512sum artifact.zip | \\     openssl pkeyutl -verify -pubin -sigfile .\/signature -inkey .\/public.pem #> Signature Verified Successfully<\/code><\/pre>\n<p>\u041a\u0440\u0430\u0441\u043e\u0442\u0430! \u0410 \u0432\u043e\u0442 \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432\u0434\u0440\u0443\u0433 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c?<\/p>\n<pre><code class=\"bash\">sha512sum artifact-15052022.zip | \\    openssl pkeyutl -verify -pubin -sigfile .\/signature -inkey .\/public.pem #> Signature Verification Failure<\/code><\/pre>\n<p>\u041e\u043e\u043f\u0441! \u041d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442&#8230;<\/p>\n<p>\u0417\u0430\u0431\u044b\u043b\u0438, \u0447\u0442\u043e sha512sum \u0432\u044b\u0434\u0430\u0451\u0442 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u043f\u043e\u0441\u043b\u0435 \u0434\u0430\u0439\u0434\u0436\u0435\u0441\u0442\u0430. \u0414\u0430 \u0438 \u043a\u0430\u043a-\u0442\u043e \u043d\u0435\u043a\u0440\u0430\u0441\u0438\u0432\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u044b\u0439 \u0434\u0430\u043c\u043f. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0431\u043b\u043e\u0431 \u0438\u0437 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u0434\u0430\u043c\u043f\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/linux.die.net\/man\/1\/xxd\" rel=\"noopener noreferrer nofollow\">xxd<\/a>:<\/p>\n<pre><code class=\"bash\"># \u041f\u043e\u043f\u044b\u0442\u043a\u0430 2 # \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043c \u0445\u0435\u0448 \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0431\u043b\u043e\u0431 \u0438 \u043f\u043e\u0434\u043f\u0438\u0448\u0435\u043c sha512sum artifact.zip | cut -f 1 -d\\  | xxd -r -p | \\     openssl pkeyutl -sign -inkey .\/private.pem > signature # \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043d\u0430 \u0444\u0430\u0439\u043b\u0435 \u0441 \u043d\u043e\u0432\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c sha512sum artifact-15052022.zip | cut -f 1 -d\\  | xxd -r -p | \\     openssl pkeyutl -verify -pubin -sigfile .\/signature -inkey .\/public.pem #> Signature Verified Successfully<\/code><\/pre>\n<p>\u041f\u043e\u0434\u043f\u0438\u0441\u044c \u0435\u0441\u0442\u044c. \u041d\u043e \u043a\u0430\u043a \u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f?<\/p>\n<h2>Powershell \u0432\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u0438\u0433\u0440\u0443<\/h2>\n<p>\u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0441 \u0443 \u041c\u0438\u043a\u0440\u043e\u0441\u043e\u0444\u0442\u0430 \u0432 \u0434\u043e\u0442\u043d\u0435\u0442\u0435 \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441 <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.security.cryptography.rsa?view=net-6.0\" rel=\"noopener noreferrer nofollow\">System.Security.Cryptography.RSA<\/a>.<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438:<\/p>\n<pre><code class=\"powershell\">$rsa = [System.Security.Cryptography.RSA]::Create() $len=0 $prifile = Get-Content -AsByteStream -Path .\/private.pem $prifile = [byte[]]$prifile $rsa.ImportRSAPublicKey($prifile, [ref] $len) #> MethodInvocationException: Exception calling \"ImportRSAPublicKey\" with \"2\" argument(s): \"error:0B09407D:x509 certificate routines:x509_pubkey_decode:public key decode error\"<\/code><\/pre>\n<p>\u041e\u043e\u043f\u0441! \u041d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<br \/>\u0423 \u043d\u0430\u0441 \u043a\u043b\u044e\u0447 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/X.509#%D0%9E%D0%B1%D1%89%D0%B5%D1%83%D0%BF%D0%BE%D1%82%D1%80%D0%B5%D0%B1%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5_%D1%80%D0%B0%D1%81%D1%88%D0%B8%D1%80%D0%B5%D0%BD%D0%B8%D1%8F_%D1%84%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2_%D1%81%D0%B5%D1%80%D1%82%D0%B8%D1%84%D0%B8%D0%BA%D0%B0%D1%82%D0%BE%D0%B2\" rel=\"noopener noreferrer nofollow\">pem<\/a> (\u0442\u043e \u0435\u0441\u0442\u044c base64 \u0434\u0430\u043c\u043f \u043a\u043b\u044e\u0447\u0430 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u0440\u0430\u0437\u0431\u0438\u0432\u043a\u043e\u0439), \u0430 \u043a\u043b\u0430\u0441\u0441 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043a\u043b\u044e\u0447 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 der (\u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0431\u043b\u043e\u0431). \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code class=\"powershell\">$prifile = Get-Content -Path .\/private.pem $prikey = $prifile -Split '`n' | Select-String -Pattern \"---\" -NotMatch | Join-String $prider = [System.Convert]::FromBase64String($prikey) $rsa.ImportRSAPrivateKey($prider, [ref] $len)<\/code><\/pre>\n<p>\u0423\u0440\u0430, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u0410 \u0435\u0441\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c?<\/p>\n<p>\u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u0442\u0430\u043a\u0430\u044f:<\/p>\n<pre><code class=\"cs\">public byte[] SignData (   byte[] data,   System.Security.Cryptography.HashAlgorithmName hashAlgorithm,   System.Security.Cryptography.RSASignaturePadding padding);<\/code><\/pre>\n<p>\u041d\u0435 \u0442\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e! \u0410 \u043f\u0440\u0438 \u0447\u0451\u043c \u0437\u0434\u0435\u0441\u044c \u0445\u0435\u0448? \u0410, \u043c\u044b \u0436\u0435 \u0443\u0436\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b.<\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u044c\u043c\u0451\u043c System.Security.Cryptography.HashAlgorithmName.SHA512 (\u043a\u0430\u043a \u0443\u0434\u0430\u0447\u043d\u043e \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 sha512sum!) \u0438, \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0441\u0442\u0438, System.Security.Cryptography.RSASignaturePadding.Pkcs1:<\/p>\n<pre><code class=\"powershell\">$data=[byte[]] (Get-Content -AsByteStream -Path .\/artifact.zip) # \u041e\u043e\u043f\u0441, \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u043f\u0430\u0440\u0430 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442, \u0430 \u0442\u0443\u043f\u0438\u0442 \u0437\u043d\u0430\u0442\u043d\u043e. \u041d\u0443 \u043b\u0430\u0434\u043d\u043e, \u043d\u0430\u0447\u043d\u0451\u043c \u0441 \u044d\u0442\u043e\u0433\u043e. $sig = $rsa.SignData($data,    [System.Security.Cryptography.HashAlgorithmName]::SHA512,    [System.Security.Cryptography.RSASignaturePadding]::Pkcs1) $sig[0] #> 140<\/code><\/pre>\n<p>\u041e\u043e\u043f\u0441! \u041d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e. \u041f\u0435\u0440\u0432\u044b\u0439 \u0431\u0430\u0439\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 openssl &#8212; 0x10. \u041d\u043e \u043a \u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0435\u0449\u0451 \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u044c:<\/p>\n<pre><code class=\"powershell\">$pubfile = Get-Content -Path .\/public.pem $pubkey = $pubfile -Split '`n' | Select-String -Pattern \"---\" -NotMatch | Join-String $pubder = [System.Convert]::FromBase64String($pubkey) $rsa.ImportRSAPublicKey($pubder, [ref] $len) #> MethodInvocationException: Exception calling \"ImportRSAPublicKey\" with \"2\" argument(s): \"error:0B09407D:x509 certificate routines:x509_pubkey_decode:public key decode error\"<\/code><\/pre>\n<p>\u0414\u0430 \u0447\u0442\u043e \u0436 \u0442\u0435\u0431\u0435 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c?!<\/p>\n<p>\u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0443 \u043a\u043b\u0430\u0441\u0441\u0430 RSA \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u0435\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430:<\/p>\n<pre><code class=\"powershell\">$rsa.ImportSubjectPublicKeyInfo($pubder, [ref] $len) # \u041d\u0443 \u043e\u043a, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043c \u0441 \u043f\u043e\u0434\u043f\u0438\u0441\u044c\u044e... $rsa.VerifyData($data, $sig,    [System.Security.Cryptography.HashAlgorithmName]::SHA512,   [System.Security.Cryptography.RSASignaturePadding]::Pkcs1) #> True<\/code><\/pre>\n<p>\u041e\u043a, \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441 powershell \u0438 openssl \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0431\u0443\u0434\u0435\u043c \u0438\u0445 \u0434\u0440\u0443\u0436\u0438\u0442\u044c.<\/p>\n<h2>Shaken, not stirred&#8230;<\/h2>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043c \u0432\u044b\u0437\u043e\u0432 openssl \u0447\u0442\u043e\u0431\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u0441\u043e\u0432\u043f\u0430\u043b\u0438 &#8212; \u0443\u043a\u0430\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u0430\u0434\u0434\u0438\u043d\u0433\u0430<\/p>\n<pre><code class=\"bash\">sha512sum artifact.zip | cut -f 1 -d\\  | xxd -r -p | \\    openssl pkeyutl -sign -inkey .\/private.pem \\      -pkeyopt rsa_padding_mode:pkcs1 -pkeyopt digest:sha512 > signature hexdump -n 1 signature #> 0000000 008c<\/code><\/pre>\n<p>\u0422\u0430\u043a \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435! \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 powershell`\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0432\u044b\u0448\u0435.<\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 &#8212; \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0443 \u043c\u0435\u043d\u044f powershell \u0433\u0440\u0443\u0437\u0438\u043b \u043f\u0430\u0440\u0443 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u0441\u0435\u043a\u0443\u043d\u0434. \u042d\u0442\u043e \u043d\u0435 \u0434\u0435\u043b\u043e. \u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u043e\u0435\u0432\u043e\u0433\u043e \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442, \u0438 \u0431\u043e\u043b\u044c\u0448\u0435. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043d\u0435\u0437\u0430\u043c\u044b\u0441\u043b\u043e\u0432\u0430\u0442\u043e: \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435 sha512 \u043e\u0442 \u0444\u0430\u0439\u043b\u0430, \u0430 sha512 \u043e\u0442 sha512 \u043e\u0442 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"bash\">sha512sum artifact.zip | cut -f 1 -d\\  | xxd -r -p | \\     sha512sum | cut -f 1 -d\\  | xxd -r -p | \\     openssl pkeyutl -sign -inkey .\/private.pem \\        -pkeyopt rsa_padding_mode:pkcs1 \\        -pkeyopt digest:sha512 > signature <\/code><\/pre>\n<pre><code class=\"powershell\">$hash=Get-FileHash -Path artifact.zip -Algorithm SHA512 $bytehash=[byte[]]($hash.Hash -replace '..','0x$&amp;,' -split ',' -ne '') $rsa.VerifyData($bytehash, $sig,     [System.Security.Cryptography.HashAlgorithmName]::SHA512,     [System.Security.Cryptography.RSASignaturePadding]::Pkcs1) #> True<\/code><\/pre>\n<p>\u0412 \u0442\u0440\u0435\u0442\u044c\u0438\u0445 &#8212; legacy. \u041a\u0443\u0434\u0430 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e!<\/p>\n<p>\u0412\u0441\u0451 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c openssl, \u043d\u043e \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0430\u0440\u044b\u0439 openssl, \u0438 \u043d\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b pkeyutl \u043a\u0430\u043a \u043a\u043b\u0430\u0441\u0441\u0430. \u0415\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0430 rsautl, \u043d\u043e \u0432 \u0435\u0451 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0434\u0430\u0442\u044c \u0442\u0438\u043f \u0445\u0435\u0448\u0430 \u0438 \u043f\u0430\u0434\u0434\u0438\u043d\u0433\u0430. \u0410 \u0435\u0449\u0451 \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <a href=\"https:\/\/www.openssl.org\/docs\/man1.1.1\/man1\/dgst.html\" rel=\"noopener noreferrer nofollow\">dgst<\/a>&#8230;<br \/>\u041f\u0443\u0442\u0451\u043c \u043d\u0430\u0443\u0447\u043d\u043e\u0433\u043e \u0442\u044b\u043a\u0430 \u0432\u044b\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u043e\u0433\u043e\u0440\u043e\u0434 \u0441 sha512sum. \u041d\u0443 \u043f\u043e\u0447\u0442\u0438 &#8212; \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0445\u0435\u0448 \u043e\u0442 \u0445\u0435\u0448\u0430.<\/p>\n<pre><code class=\"bash\">openssl dgst -sign .\/private.pem \\      -sigopt rsa_padding_mode:pkcs1 -sha512 artifact.zip > signature hexdump -n 1 .\/signature  #> 0000000 008c openssl dgst -verify .\/public.pem \\     -sigopt rsa_padding_mode:pkcs1 -sha512 -signature signature artifact.zip  #> Verified OK <\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u0445\u043e\u0440\u043e\u0448\u043e, \u0432 \u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 openssl \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0435\u0449\u0451 \u043d\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 -sigopt, \u043d\u043e, \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0442\u0430\u043c \u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f Pkcs1.<\/p>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c \u043d\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435, \u0430 \u043c\u044b \u0438\u0449\u0435\u043c \u043a\u0443\u0434\u0430 \u0431\u044b \u0437\u0430\u043d\u044b\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0438 \u043d\u0435 \u0437\u0430\u0441\u0432\u0435\u0442\u0438\u0442\u044c.<\/p>\n<hr\/>\n<p>\u0421\u0441\u044b\u043b\u043a\u0438:<\/p>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/RSA\" rel=\"noopener noreferrer nofollow\">https:\/\/ru.wikipedia.org\/wiki\/RSA<\/a><\/p>\n<p><a href=\"https:\/\/www.openssl.org\/docs\/manmaster\/man1\/openssl.html\" rel=\"noopener noreferrer nofollow\">https:\/\/www.openssl.org\/docs\/manmaster\/man1\/openssl.html<\/a><\/p>\n<p><a href=\"https:\/\/www.openssl.org\/docs\/man1.1.1\/man1\/openssl-pkeyutl.html\" rel=\"noopener noreferrer nofollow\">https:\/\/www.openssl.org\/docs\/man1.1.1\/man1\/openssl-pkeyutl.html<\/a><\/p>\n<p><a href=\"https:\/\/www.openssl.org\/docs\/man1.1.1\/man1\/dgst.html\" rel=\"noopener noreferrer nofollow\">https:\/\/www.openssl.org\/docs\/man1.1.1\/man1\/dgst.html<\/a><\/p>\n<p><a href=\"https:\/\/man7.org\/linux\/man-pages\/man1\/sha512sum.1.html\" rel=\"noopener noreferrer nofollow\">https:\/\/man7.org\/linux\/man-pages\/man1\/sha512sum.1.html<\/a><\/p>\n<p><a href=\"https:\/\/linux.die.net\/man\/1\/xxd\" rel=\"noopener noreferrer nofollow\">https:\/\/linux.die.net\/man\/1\/xxd<\/a><\/p>\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.security.cryptography.rsa?view=net-6.0\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.security.cryptography.rsa?view=net-6.0<\/a><\/p>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/X.509#%D0%9E%D0%B1%D1%89%D0%B5%D1%83%D0%BF%D0%BE%D1%82%D1%80%D0%B5%D0%B1%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5_%D1%80%D0%B0%D1%81%D1%88%D0%B8%D1%80%D0%B5%D0%BD%D0%B8%D1%8F_%D1%84%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2_%D1%81%D0%B5%D1%80%D1%82%D0%B8%D1%84%D0%B8%D0%BA%D0%B0%D1%82%D0%BE%D0%B2\" rel=\"noopener noreferrer nofollow\">https:\/\/ru.wikipedia.org\/wiki\/X.509#\u041e\u0431\u0449\u0435\u0443\u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435_\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f_\u0444\u0430\u0439\u043b\u043e\u0432_\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432<\/a><\/p>\n<p><a href=\"https:\/\/medium.com\/@bn121rajesh\/rsa-sign-and-verify-using-openssl-behind-the-scene-bf3cac0aade2\" rel=\"noopener noreferrer nofollow\">https:\/\/medium.com\/@bn121rajesh\/rsa-sign-and-verify-using-openssl-behind-the-scene-bf3cac0aade2<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/665768\/\"> https:\/\/habr.com\/ru\/post\/665768\/<\/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>\u0412 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0434\u0435\u043d\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0442\u0443\u0445.<\/p>\n<p>\u041d\u0443 \u043f\u0440\u043e\u0442\u0443\u0445 \u0438 \u043f\u0440\u043e\u0442\u0443\u0445, \u0441\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f. \u0423 \u043d\u0430\u0441 \u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442! \u0429\u0430\u0441 \u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043f\u0438\u0448\u0435\u043c, \u0438 \u0432\u0441\u0451 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0438 \u043d\u0435\u0442. \u0423 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 &#8212; \u043d\u043e\u0432\u0430\u044f \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u0434\u043e\u0432\u0435\u0440\u0438\u044f, \u0430 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u0443\u0434\u0430 \u043c\u044b \u0441\u0442\u0430\u0432\u0438\u043c\u0441\u044f \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u043e\u0442 (\u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0432\u0435\u0441\u044c\u043c\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e) CA \u0432 \u0441\u0432\u043e\u0451 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432.<\/p>\n<p>\u041d\u043e \u043e\u043d\u0438 \u0433\u043e\u0442\u043e\u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 powershell, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c, \u0430 \u043f\u043e\u0442\u043e\u043c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0435\u0439. \u0414\u0430 \u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0431\u044b\u0442\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0448 \u043a\u043e\u0434. \u0410 \u043f\u0430\u043a\u0443\u0435\u043c \u043c\u044b \u043a\u043e\u0434 \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e powershell \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u0438\u0437\u043e\u0432\u0451\u043c \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e, \u0438 \u043d\u0430\u0431\u044c\u0451\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0448\u0438\u0448\u0435\u043a.<\/p>\n<hr\/>\n<details class=\"spoiler\">\n<summary>\u041f\u0430\u0440\u0430 \u0441\u043b\u043e\u0432 \u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p>\u041d\u0435 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0439\u0442\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e. \u0415\u0451 \u0441\u043b\u043e\u043c\u0430\u044e\u0442.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0439\u0442\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438. \u042d\u0442\u043e \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u0448\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c\u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u043a\u0440\u0438\u043f\u0442\u043e\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b. \u0412\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0414\u043b\u044f \u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u0442\u0435\u0440\u043f\u0435\u043b\u0438\u0432\u044b\u0445, \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439, \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 openssl:<\/p>\n<pre><code class=\"bash\">openssl genrsa -out private.pem 4096 openssl rsa -in private.pem -pubout -out public.pem sha512sum artifact.zip | cut -f 1 -d\\  | xxd -r -p | \\     openssl dgst -sign .\/private.pem \\       -sigopt rsa_padding_mode:pkcs1 -sha512 > signature sha512sum artifact.zip | cut -f 1 -d\\  | xxd -r -p | \\     openssl dgst -verify .\/public.pem -signature signature       -sigopt rsa_padding_mode:pkcs1 -sha512<\/code><\/pre>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043a\u043b\u044e\u0447\u0435\u0439, \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432 PowerShell:<\/p>\n<pre><code class=\"powershell\">$hash=Get-FileHash -Path artifact.zip -Algorithm SHA512 $bytehash=[byte[]]($hash.Hash -replace '..','0x$&amp;,' -split ',' -ne '') $rsa = [System.Security.Cryptography.RSA]::Create() $len=0  $prifile = Get-Content -Path .\/private.pem $prikey = $prifile -Split '`n' | Select-String -Pattern \"---\" -NotMatch | Join-String $prider = [System.Convert]::FromBase64String($prikey) $rsa.ImportRSAPrivateKey($prider, [ref] $len) $sig = $rsa.SignData($bytehash,     [System.Security.Cryptography.HashAlgorithmName]::SHA512,     [System.Security.Cryptography.RSASignaturePadding]::Pkcs1)  $pubfile = Get-Content -Path .\/public.pem $pubkey = $pubfile -Split '`n' | Select-String -Pattern \"---\" -NotMatch | Join-String $pubder = [System.Convert]::FromBase64String($pubkey) $rsa.ImportSubjectPublicKeyInfo($pubder, [ref] $len) $rsa.VerifyData($bytehash, $sig,     [System.Security.Cryptography.HashAlgorithmName]::SHA512,     [System.Security.Cryptography.RSASignaturePadding]::Pkcs1)<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u0414\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u044c<\/h2>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u043c\u044b\u0439 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442 \u0438 \u0440\u0430\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u0441 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u043c. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <a href=\"https:\/\/www.openssl.org\/docs\/manmaster\/man1\/openssl.html\" rel=\"noopener noreferrer nofollow\">openssl<\/a> \u0438 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/RSA\" rel=\"noopener noreferrer nofollow\">RSA<\/a> &#8212; \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c.<\/p>\n<p>\u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0441 \u0432 openssl \u0435\u0441\u0442\u044c \u0431\u043b\u043e\u043a \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 &#171;\u043d\u0438\u0437\u043a\u043e\u0433\u043e&#187; \u0443\u0440\u043e\u0432\u043d\u044f &#8212; <a href=\"https:\/\/www.openssl.org\/docs\/man1.1.1\/man1\/openssl-pkeyutl.html\" rel=\"noopener noreferrer nofollow\">pkeyutl<\/a><\/p>\n<pre><code class=\"bash\"># \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0438, \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 openssl genrsa -out private.pem 4096 openssl rsa -in private.pem -pubout -out public.pem # \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0430\u0439\u043b openssl pkeyutl -sign -inkey .\/private.pem -in artifact.zip #> Public Key operation error #> 140052316043152:error:0406C06E:rsa routines:RSA_padding_add_PKCS1_type_1:data too large for key size:rsa_pk1.c:75:<\/code><\/pre>\n<p>\u041e\u043e\u043f\u0441! \u041d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442&#8230;<\/p>\n<p>RSA \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043b\u044e\u0447\u0430 \u043c\u0438\u043d\u0443\u0441 <a href=\"https:\/\/medium.com\/@bn121rajesh\/rsa-sign-and-verify-using-openssl-behind-the-scene-bf3cac0aade2\" rel=\"noopener noreferrer nofollow\">\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a<\/a>.<\/p>\n<p>\u041d\u0443 \u0434\u0430 \u043b\u0430\u0434\u043d\u043e, \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0442\u044c. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 &#8212; \u0437\u0430\u0445\u0435\u0448\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b. \u041a\u043b\u044e\u0447 \u0443 \u043d\u0430\u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u043e\u0437\u044c\u043c\u0451\u043c <a href=\"https:\/\/man7.org\/linux\/man-pages\/man1\/sha512sum.1.html\" rel=\"noopener noreferrer nofollow\">SHA512<\/a>:<\/p>\n<pre><code class=\"bash\"># \u041f\u043e\u043f\u044b\u0442\u043a\u0430 1 # \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u0445\u043b\u043e\u043f sha512sum sha512sum artifact.zip | openssl pkeyutl -sign -inkey .\/private.pem > signature # \u0438 \u0442\u0443\u0442 \u0436\u0435 \u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c sha512sum artifact.zip | \\     openssl pkeyutl -verify -pubin -sigfile .\/signature -inkey .\/public.pem #> Signature Verified Successfully<\/code><\/pre>\n<p>\u041a\u0440\u0430\u0441\u043e\u0442\u0430! \u0410 \u0432\u043e\u0442 \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432\u0434\u0440\u0443\u0433 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c?<\/p>\n<pre><code class=\"bash\">sha512sum artifact-15052022.zip | \\    openssl pkeyutl -verify -pubin -sigfile .\/signature -inkey .\/public.pem #> Signature Verification Failure<\/code><\/pre>\n<p>\u041e\u043e\u043f\u0441! \u041d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442&#8230;<\/p>\n<p>\u0417\u0430\u0431\u044b\u043b\u0438, \u0447\u0442\u043e sha512sum \u0432\u044b\u0434\u0430\u0451\u0442 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u043f\u043e\u0441\u043b\u0435 \u0434\u0430\u0439\u0434\u0436\u0435\u0441\u0442\u0430. \u0414\u0430 \u0438 \u043a\u0430\u043a-\u0442\u043e \u043d\u0435\u043a\u0440\u0430\u0441\u0438\u0432\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u044b\u0439 \u0434\u0430\u043c\u043f. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0431\u043b\u043e\u0431 \u0438\u0437 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u0434\u0430\u043c\u043f\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/linux.die.net\/man\/1\/xxd\" rel=\"noopener noreferrer nofollow\">xxd<\/a>:<\/p>\n<pre><code class=\"bash\"># \u041f\u043e\u043f\u044b\u0442\u043a\u0430 2 # \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043c \u0445\u0435\u0448 \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0431\u043b\u043e\u0431 \u0438 \u043f\u043e\u0434\u043f\u0438\u0448\u0435\u043c sha512sum artifact.zip | cut -f 1 -d\\  | xxd -r -p | \\     openssl pkeyutl -sign -inkey .\/private.pem > signature # \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043d\u0430 \u0444\u0430\u0439\u043b\u0435 \u0441 \u043d\u043e\u0432\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c sha512sum artifact-15052022.zip | cut -f 1 -d\\  | xxd -r -p | \\     openssl pkeyutl -verify -pubin -sigfile .\/signature -inkey .\/public.pem #> Signature Verified Successfully<\/code><\/pre>\n<p>\u041f\u043e\u0434\u043f\u0438\u0441\u044c \u0435\u0441\u0442\u044c. \u041d\u043e \u043a\u0430\u043a \u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f?<\/p>\n<h2>Powershell \u0432\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u0438\u0433\u0440\u0443<\/h2>\n<p>\u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0441 \u0443 \u041c\u0438\u043a\u0440\u043e\u0441\u043e\u0444\u0442\u0430 \u0432 \u0434\u043e\u0442\u043d\u0435\u0442\u0435 \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441 <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.security.cryptography.rsa?view=net-6.0\" rel=\"noopener noreferrer nofollow\">System.Security.Cryptography.RSA<\/a>.<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438:<\/p>\n<pre><code class=\"powershell\">$rsa = [System.Security.Cryptography.RSA]::Create() $len=0 $prifile = Get-Content -AsByteStream -Path .\/private.pem $prifile = [byte[]]$prifile $rsa.ImportRSAPublicKey($prifile, [ref] $len) #> MethodInvocationException: Exception calling \"ImportRSAPublicKey\" with \"2\" argument(s): \"error:0B09407D:x509 certificate routines:x509_pubkey_decode:public key decode error\"<\/code><\/pre>\n<p>\u041e\u043e\u043f\u0441! \u041d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<br \/>\u0423 \u043d\u0430\u0441 \u043a\u043b\u044e\u0447 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/X.509#%D0%9E%D0%B1%D1%89%D0%B5%D1%83%D0%BF%D0%BE%D1%82%D1%80%D0%B5%D0%B1%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5_%D1%80%D0%B0%D1%81%D1%88%D0%B8%D1%80%D0%B5%D0%BD%D0%B8%D1%8F_%D1%84%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2_%D1%81%D0%B5%D1%80%D1%82%D0%B8%D1%84%D0%B8%D0%BA%D0%B0%D1%82%D0%BE%D0%B2\" rel=\"noopener noreferrer nofollow\">pem<\/a> (\u0442\u043e \u0435\u0441\u0442\u044c base64 \u0434\u0430\u043c\u043f \u043a\u043b\u044e\u0447\u0430 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u0440\u0430\u0437\u0431\u0438\u0432\u043a\u043e\u0439), \u0430 \u043a\u043b\u0430\u0441\u0441 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043a\u043b\u044e\u0447 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 der (\u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0431\u043b\u043e\u0431). \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code class=\"powershell\">$prifile = Get-Content -Path .\/private.pem $prikey = $prifile -Split '`n' | Select-String -Pattern \"---\" -NotMatch | Join-String $prider = [System.Convert]::FromBase64String($prikey) $rsa.ImportRSAPrivateKey($prider, [ref] $len)<\/code><\/pre>\n<p>\u0423\u0440\u0430, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u0410 \u0435\u0441\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c?<\/p>\n<p>\u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u0442\u0430\u043a\u0430\u044f:<\/p>\n<pre><code class=\"cs\">public byte[] SignData (   byte[] data,   System.Security.Cryptography.HashAlgorithmName hashAlgorithm,   System.Security.Cryptography.RSASignaturePadding padding);<\/code><\/pre>\n<p>\u041d\u0435 \u0442\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e! \u0410 \u043f\u0440\u0438 \u0447\u0451\u043c \u0437\u0434\u0435\u0441\u044c \u0445\u0435\u0448? \u0410, \u043c\u044b \u0436\u0435 \u0443\u0436\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b.<\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u044c\u043c\u0451\u043c System.Security.Cryptography.HashAlgorithmName.SHA512 (\u043a\u0430\u043a \u0443\u0434\u0430\u0447\u043d\u043e \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 sha512sum!) \u0438, \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0441\u0442\u0438, System.Security.Cryptography.RSASignaturePadding.Pkcs1:<\/p>\n<pre><code class=\"powershell\">$data=[byte[]] (Get-Content -AsByteStream -Path .\/artifact.zip) # \u041e\u043e\u043f\u0441, \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u043f\u0430\u0440\u0430 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442, \u0430 \u0442\u0443\u043f\u0438\u0442 \u0437\u043d\u0430\u0442\u043d\u043e. \u041d\u0443 \u043b\u0430\u0434\u043d\u043e, \u043d\u0430\u0447\u043d\u0451\u043c \u0441 \u044d\u0442\u043e\u0433\u043e. $sig = $rsa.SignData($data,    [System.Security.Cryptography.HashAlgorithmName]::SHA512,    [System.Security.Cryptography.RSASignaturePadding]::Pkcs1) $sig[0] #> 140<\/code><\/pre>\n<p>\u041e\u043e\u043f\u0441! \u041d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e. \u041f\u0435\u0440\u0432\u044b\u0439 \u0431\u0430\u0439\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 openssl &#8212; 0x10. \u041d\u043e \u043a \u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0435\u0449\u0451 \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u044c:<\/p>\n<pre><code class=\"powershell\">$pubfile = Get-Content -Path .\/public.pem $pubkey = $pubfile -Split '`n' | Select-String -Pattern \"---\" -NotMatch | Join-String $pubder = [System.Convert]::FromBase64String($pubkey) $rsa.ImportRSAPublicKey($pubder, [ref] $len) #> MethodInvocationException: Exception calling \"ImportRSAPublicKey\" with \"2\" argument(s): \"error:0B09407D:x509 certificate routines:x509_pubkey_decode:public key decode error\"<\/code><\/pre>\n<p>\u0414\u0430 \u0447\u0442\u043e \u0436 \u0442\u0435\u0431\u0435 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c?!<\/p>\n<p>\u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0443 \u043a\u043b\u0430\u0441\u0441\u0430 RSA \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u0435\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430:<\/p>\n<pre><code class=\"powershell\">$rsa.ImportSubjectPublicKeyInfo($pubder, [ref] $len) # \u041d\u0443 \u043e\u043a, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043c \u0441 \u043f\u043e\u0434\u043f\u0438\u0441\u044c\u044e... $rsa.VerifyData($data, $sig,    [System.Security.Cryptography.HashAlgorithmName]::SHA512,   [System.Security.Cryptography.RSASignaturePadding]::Pkcs1) #> True<\/code><\/pre>\n<p>\u041e\u043a, \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441 powershell \u0438 openssl \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0431\u0443\u0434\u0435\u043c \u0438\u0445 \u0434\u0440\u0443\u0436\u0438\u0442\u044c.<\/p>\n<h2>Shaken, not stirred&#8230;<\/h2>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043c \u0432\u044b\u0437\u043e\u0432 openssl \u0447\u0442\u043e\u0431\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u0441\u043e\u0432\u043f\u0430\u043b\u0438 &#8212; \u0443\u043a\u0430\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u0430\u0434\u0434\u0438\u043d\u0433\u0430<\/p>\n<pre><code class=\"bash\">sha512sum artifact.zip | cut -f 1 -d\\  | xxd -r -p | \\    openssl pkeyutl -sign -inkey .\/private.pem \\      -pkeyopt rsa_padding_mode:pkcs1 -pkeyopt digest:sha512 > signature hexdump -n 1 signature #> 0000000 008c<\/code><\/pre>\n<p>\u0422\u0430\u043a \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435! \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 powershell`\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0432\u044b\u0448\u0435.<\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 &#8212; \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0443 \u043c\u0435\u043d\u044f powershell \u0433\u0440\u0443\u0437\u0438\u043b \u043f\u0430\u0440\u0443 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u0441\u0435\u043a\u0443\u043d\u0434. \u042d\u0442\u043e \u043d\u0435 \u0434\u0435\u043b\u043e. \u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u043e\u0435\u0432\u043e\u0433\u043e \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442, \u0438 \u0431\u043e\u043b\u044c\u0448\u0435. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043d\u0435\u0437\u0430\u043c\u044b\u0441\u043b\u043e\u0432\u0430\u0442\u043e: \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435 sha512 \u043e\u0442 \u0444\u0430\u0439\u043b\u0430, \u0430 sha512 \u043e\u0442 sha512 \u043e\u0442 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"bash\">sha512sum artifact.zip | cut -f 1 -d\\  | xxd -r -p | \\     sha512sum | cut -f 1 -d\\  | xxd -r -p | \\     openssl pkeyutl -sign -inkey .\/private.pem \\        -pkeyopt rsa_padding_mode:pkcs1 \\        -pkeyopt digest:sha512 > signature <\/code><\/pre>\n<pre><code class=\"powershell\">$hash=Get-FileHash -Path artifact.zip -Algorithm SHA512 $bytehash=[byte[]]($hash.Hash -replace '..','0x$&amp;,' -split ',' -ne '') $rsa.VerifyData($bytehash, $sig,     [System.Security.Cryptography.HashAlgorithmName]::SHA512,     [System.Security.Cryptography.RSASignaturePadding]::Pkcs1) #> True<\/code><\/pre>\n<p>\u0412 \u0442\u0440\u0435\u0442\u044c\u0438\u0445 &#8212; legacy. \u041a\u0443\u0434\u0430 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e!<\/p>\n<p>\u0412\u0441\u0451 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c openssl, \u043d\u043e \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0430\u0440\u044b\u0439 openssl, \u0438 \u043d\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b pkeyutl \u043a\u0430\u043a \u043a\u043b\u0430\u0441\u0441\u0430. \u0415\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0430 rsautl, \u043d\u043e \u0432 \u0435\u0451 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0434\u0430\u0442\u044c \u0442\u0438\u043f \u0445\u0435\u0448\u0430 \u0438 \u043f\u0430\u0434\u0434\u0438\u043d\u0433\u0430. \u0410 \u0435\u0449\u0451 \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <a href=\"https:\/\/www.openssl.org\/docs\/man1.1.1\/man1\/dgst.html\" rel=\"noopener noreferrer nofollow\">dgst<\/a>&#8230;<br \/>\u041f\u0443\u0442\u0451\u043c \u043d\u0430\u0443\u0447\u043d\u043e\u0433\u043e \u0442\u044b\u043a\u0430 \u0432\u044b\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u043e\u0433\u043e\u0440\u043e\u0434 \u0441 sha512sum. \u041d\u0443 \u043f\u043e\u0447\u0442\u0438 &#8212; \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0445\u0435\u0448 \u043e\u0442 \u0445\u0435\u0448\u0430.<\/p>\n<pre><code class=\"bash\">openssl dgst -sign .\/private.pem \\      -sigopt rsa_padding_mode:pkcs1 -sha512 artifact.zip > signature hexdump -n 1 .\/signature  #> 0000000 008c openssl dgst -verify .\/public.pem \\     -sigopt rsa_padding_mode:pkcs1 -sha512 -signature signature artifact.zip  #> Verified OK <\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u0445\u043e\u0440\u043e\u0448\u043e, \u0432 \u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 openssl \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0435\u0449\u0451 \u043d\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 -sigopt, \u043d\u043e, \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0442\u0430\u043c \u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f Pkcs1.<\/p>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c \u043d\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435, \u0430 \u043c\u044b \u0438\u0449\u0435\u043c \u043a\u0443\u0434\u0430 \u0431\u044b \u0437\u0430\u043d\u044b\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0438 \u043d\u0435 \u0437\u0430\u0441\u0432\u0435\u0442\u0438\u0442\u044c.<\/p>\n<hr\/>\n<p>\u0421\u0441\u044b\u043b\u043a\u0438:<\/p>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/RSA\" rel=\"noopener noreferrer nofollow\">https:\/\/ru.wikipedia.org\/wiki\/RSA<\/a><\/p>\n<p><a href=\"https:\/\/www.openssl.org\/docs\/manmaster\/man1\/openssl.html\" rel=\"noopener noreferrer nofollow\">https:\/\/www.openssl.org\/docs\/manmaster\/man1\/openssl.html<\/a><\/p>\n<p><a href=\"https:\/\/www.openssl.org\/docs\/man1.1.1\/man1\/openssl-pkeyutl.html\" rel=\"noopener noreferrer nofollow\">https:\/\/www.openssl.org\/docs\/man1.1.1\/man1\/openssl-pkeyutl.html<\/a><\/p>\n<p><a href=\"https:\/\/www.openssl.org\/docs\/man1.1.1\/man1\/dgst.html\" rel=\"noopener noreferrer nofollow\">https:\/\/www.openssl.org\/docs\/man1.1.1\/man1\/dgst.html<\/a><\/p>\n<p><a href=\"https:\/\/man7.org\/linux\/man-pages\/man1\/sha512sum.1.html\" rel=\"noopener noreferrer nofollow\">https:\/\/man7.org\/linux\/man-pages\/man1\/sha512sum.1.html<\/a><\/p>\n<p><a href=\"https:\/\/linux.die.net\/man\/1\/xxd\" rel=\"noopener noreferrer nofollow\">https:\/\/linux.die.net\/man\/1\/xxd<\/a><\/p>\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.security.cryptography.rsa?view=net-6.0\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.security.cryptography.rsa?view=net-6.0<\/a><\/p>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/X.509#%D0%9E%D0%B1%D1%89%D0%B5%D1%83%D0%BF%D0%BE%D1%82%D1%80%D0%B5%D0%B1%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5_%D1%80%D0%B0%D1%81%D1%88%D0%B8%D1%80%D0%B5%D0%BD%D0%B8%D1%8F_%D1%84%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2_%D1%81%D0%B5%D1%80%D1%82%D0%B8%D1%84%D0%B8%D0%BA%D0%B0%D1%82%D0%BE%D0%B2\" rel=\"noopener noreferrer nofollow\">https:\/\/ru.wikiped<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-333135","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/333135","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=333135"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/333135\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=333135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=333135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=333135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}