{"id":3683,"date":"2016-04-19T22:56:13","date_gmt":"2016-04-19T20:56:13","guid":{"rendered":"http:\/\/michlstechblog.info\/blog\/?p=3683"},"modified":"2016-04-20T13:01:05","modified_gmt":"2016-04-20T11:01:05","slug":"openssl-check-if-a-certificate-belongs-to-a-private-key","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/openssl-check-if-a-certificate-belongs-to-a-private-key\/","title":{"rendered":"OpenSSL: Check if a certificate belongs to a private key"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_3683 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_3683')){$('.twoclick_social_bookmarks_post_3683').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"OpenSSL%3A%20Check%20if%20a%20certificate%20belongs%20to%20a%20private%20key\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Aif%20you%20want%20to%20check%20if%20a%20certificate%20has%20it%20s%20origin%20in%20a%20specific%20private%20key%20respectively%20the%20signing%20request%20use%20the%20following%20openssl%20commands%3A%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/openssl-check-if-a-certificate-belongs-to-a-private-key\\\/\",\"post_id\":3683,\"post_title_referrer_track\":\"OpenSSL%3A+Check+if+a+certificate+belongs+to+a+private+key\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>if you want to check if a certificate has it s origin in a specific private key respectively the signing request use the following openssl commands:<br \/>\n<!--more--><br \/>\nThis shows all details of the key and certificate:<br \/>\n<code><br \/>\nroot@debdev ~# openssl x509 -noout -text -in yourserver.crt<br \/>\nroot@debdev ~# openssl rsa -noout -text -in yourserver.key<br \/>\n<\/code><\/p>\n<p>The interesting parts are the modulus and the public exponent section where the public exponent is usually 65537 so it can be ignored.<\/p>\n<p><code><br \/>\nroot@debdev ~# openssl x509 -noout -modulus -in yourserver.pem | md5sum<br \/>\nroot@debdev ~# openssl rsa -noout -modulus -in yourserver.key | md5sum<br \/>\n<\/code><\/p>\n<p>The output of both commands must match.<\/p>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, if you want to check if a certificate has it s origin in a specific private key respectively the signing request use the following openssl commands:<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,466],"tags":[839,84,838,840,547],"class_list":["post-3683","post","type-post","status-publish","format-standard","hentry","category-linux","category-security","tag-belongs-to","tag-certificate","tag-key","tag-match","tag-openssl"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/3683","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=3683"}],"version-history":[{"count":4,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/3683\/revisions"}],"predecessor-version":[{"id":3687,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/3683\/revisions\/3687"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=3683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=3683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=3683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}