{"id":1197,"date":"2017-02-13T19:48:36","date_gmt":"2017-02-13T10:48:36","guid":{"rendered":"https:\/\/ecoop.net\/memo\/?p=1197"},"modified":"2017-02-13T21:36:13","modified_gmt":"2017-02-13T12:36:13","slug":"how-to-show-p12-certification-information","status":"publish","type":"post","link":"https:\/\/www.ecoop.net\/memo\/archives\/how-to-show-p12-certification-information.html","title":{"rendered":"[iOS][OpenSSL] .p12\u30ad\u30fc\u30b9\u30c8\u30a2\u30d5\u30a1\u30a4\u30eb\u8a3c\u660e\u66f8\u306e\u4e2d\u8eab\u3092\u78ba\u8a8d\u3059\u308b"},"content":{"rendered":"<p>iOS\u958b\u767a\u3067\u983b\u7e41\u306b\u304a\u4e16\u8a71\u306b\u306a\u308b .p12 \u30d5\u30a1\u30a4\u30eb(\u79d8\u5bc6\u9375\uff0b\u8a3c\u660e\u66f8\u306e\u30bb\u30c3\u30c8)\u306e\u60c5\u5831\u3092\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<br \/>\nSHA1\u30d5\u30a3\u30f3\u30ac\u30fc\u30d7\u30ea\u30f3\u30c8\u3001\u6709\u52b9\u671f\u9650\u3001\u30c1\u30fc\u30e0ID,\u540d\u524d\u306a\u3069\u304c\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u7c21\u5358\u306b\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<h3>keytool \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u65b9\u6cd5<\/h3>\n<p>\u3053\u3061\u3089\u304c\u57fa\u672c\u7684\u306a\u65b9\u6cd5\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nkeytool -list -v -keystore mykeystore.p12 -storetype PKCS12 -storepass foobar\n<\/pre>\n<p>(mykeystore.p12 \u306f\u7f72\u540d\u3092\u78ba\u8a8d\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u540d\u3002foobar\u306f\u30ad\u30fc\u30b9\u30c8\u30a2\u306b\u304b\u3051\u3066\u3044\u308b\u30d1\u30b9\u30ef\u30fc\u30c9)<br \/>\n\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u306a\u3044\u5834\u5408\u3001 -storepass &#8220;&#8221; \u306e\u3088\u3046\u306b\u7a7a\u6587\u5b57\u5217\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u7d50\u679c\uff1a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u30ad\u30fc\u30b9\u30c8\u30a2\u306e\u30bf\u30a4\u30d7: PKCS12\n\u30ad\u30fc\u30b9\u30c8\u30a2\u30fb\u30d7\u30ed\u30d0\u30a4\u30c0: SunJSSE\n\n\u30ad\u30fc\u30b9\u30c8\u30a2\u306b\u306f1\u30a8\u30f3\u30c8\u30ea\u304c\u542b\u307e\u308c\u307e\u3059\n\n\u5225\u540d: ios distribution: foo inc.\n\u4f5c\u6210\u65e5: 2017\/02\/13\n\u30a8\u30f3\u30c8\u30ea\u30fb\u30bf\u30a4\u30d7: PrivateKeyEntry\n\u8a3c\u660e\u66f8\u30c1\u30a7\u30fc\u30f3\u306e\u9577\u3055: 1\n\u8a3c\u660e\u66f8&#x5B;1]:\n\u6240\u6709\u8005: C=US, O=foo Inc., OU=Q000000000, CN=iPhone Distribution: foo Inc. (Q000000000), UID=Q0\n\u767a\u884c\u8005: CN=Apple Worldwide Developer Relations Certification Authority, OU=Apple Worldwide Developer\n\u30b7\u30ea\u30a2\u30eb\u756a\u53f7: 437e610e0f54ed7f\n\u6709\u52b9\u671f\u9593\u306e\u958b\u59cb\u65e5: Tue Sep 10 12:30:17 JST 2016 \u7d42\u4e86\u65e5: Wed Sep 10 12:30:17 JST 2017\n\u8a3c\u660e\u66f8\u306e\u30d5\u30a3\u30f3\u30ac\u30d7\u30ea\u30f3\u30c8:\n         MD5:  4F:2A:8B:EB:8B:65:A9:84:63:87:58:12:AE:85:63:1A\n         SHA1: 8A:46:5E:B1:77:16:3E:68:A9:DE:EE:74:7F:2A:AF:DD:6C:AE:21:FF\n         SHA256: 4A:A1:24:BE:0F:7C:4F:65:C2:1D:01:BB:02:65:E0:85:59:A6:EC:3E:3F:60:33:E7:B3:D2:A2:01\n         \u7f72\u540d\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u540d: SHA256withRSA\n         \u30d0\u30fc\u30b8\u30e7\u30f3: 3\n\u301c\u4ee5\u4e0b\u7565\u301c\n<\/pre>\n<h3>openssl \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u65b9\u6cd5<\/h3>\n<p>openssl \u30b3\u30de\u30f3\u30c9\u304b\u3089\u8a3c\u660e\u66f8\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u3082\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<br \/>\np12\u3060\u3051\u3092\u6271\u3046\u306a\u3089keytool \u306e\u307b\u3046\u304c\u8868\u793a\u3082\u898b\u3084\u3059\u304f\u4fbf\u5229\u3067\u3059\u304c\u3001<br \/>\n\u8a3c\u660e\u66f8\u306e\u64cd\u4f5c\u3001\u5909\u63db\u306a\u3069\u3001\u6c4e\u7528\u7684\u306a\u51e6\u7406\u3092\u884c\u3048\u308b openssl \u3067\u306e\u3084\u308a\u65b9\u3082\u77e5\u3063\u3066\u304a\u304f\u3068\u8a33\u306b\u7acb\u3064\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nopenssl pkcs12 -in mykeystore.p12 -nodes  -passin pass:foobar |openssl x509 -noout -fingerprint<\/pre>\n<p>(mykeystore.p12 \u306f\u7f72\u540d\u3092\u78ba\u8a8d\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u540d\u3002foobar\u306f\u30ad\u30fc\u30b9\u30c8\u30a2\u306b\u304b\u3051\u3066\u3044\u308b\u30d1\u30b9\u30ef\u30fc\u30c9\u3002\u30d1\u30b9\u30ef\u30fc\u30c9\u306a\u3057\u306e\u3068\u304d\u306f\u30d1\u30b9\u30ef\u30fc\u30c9\u3060\u3051\u7701\u7565\u3057\u3066\u3001 -passin pass: \u3068\u3057\u3066\u304f\u3060\u3055\u3044\u3002)<\/p>\n<p>\u7d50\u679c\uff1a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nMAC verified OK\nCertificate:\n    Data:\n        Version: 3 (0x2)\n        Serial Number:\n            1a:7f:78:be:0e:55:ef:a0\n        Signature Algorithm: sha256WithRSAEncryption\n        Issuer: C=US, O=Apple Inc., OU=Apple Worldwide Developer Relations, CN=Apple Worldwide Developer Relations Certification Authority\n        Validity\n            Not Before: Sep 10 12:30:17 2016 GMT\n            Not After : Sep 10 12:30:17 2017 GMT\n        Subject: UID=Q000000000, CN=iPhone Distribution: foo Inc. (Q000000000), OU=Q000000000, O=foo Inc., C=US\n        Subject Public Key Info:\n            Public Key Algorithm: rsaEncryption\n            RSA Public Key: (2048 bit)\n                Modulus (2048 bit):\n\u301c\u4ee5\u4e0b\u7565\u301c\n<\/pre>\n<p>\u30d5\u30a3\u30f3\u30ac\u30fc\u30d7\u30ea\u30f3\u30c8\u3060\u3051\u307b\u3057\u3044\u3068\u304d\u306f\u3001 -text \u306a\u3057\u3067\u3082OK\u3067\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nopenssl pkcs12 -in mykeystore.p12 -nodes  -passin pass:foobar |openssl x509 -noout -fingerprint<\/pre>\n<p>\u7d50\u679c\uff1a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nMAC verified OK\nSHA1 Fingerprint=8A:46:5E:B1:77:16:3E:68:A9:DE:EE:74:7F:2A:AF:DD:6C:AE:21:FF\n<\/pre>\n<h3>\u3069\u3046\u3044\u3046\u3068\u304d\u306b\u4f7f\u3046\uff1f<\/h3>\n<p>xcodebuild, ipa \u306a\u3069\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u30d3\u30eb\u30c9\u3059\u308b\u3068\u304d\u306b\u3001\u672c\u5f53\u306b\u6b63\u3057\u3044\u7f72\u540d\u304c\u4f7f\u308f\u308c\u3066\u3044\u308b\u304b\u306e\u78ba\u8a8d\u306b\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\nCircle CI \u306a\u3069\u306e\u81ea\u52d5\u30d3\u30eb\u30c9\u30ed\u30b0\u306a\u3069\u3092\u78ba\u8a8d\u3059\u308b\u3068\u304d\u306b\u77e5\u3063\u3066\u308b\u3068\u4fbf\u5229\u3067\u3059\u306d\u3002<\/p>\n<h3>\u95a2\u9023<\/h3>\n<p>\u30b5\u30fc\u30d0\u306a\u3069\u3067p12\u3068\u540c\u69d8\u306b\u4f7f\u308f\u308c\u308b\u3000pem \u30d5\u30a1\u30a4\u30eb\u306e\u6271\u3044\u65b9\u306b\u3064\u3044\u3066\u306f\u3001\u5225\u306e\u8a18\u4e8b\u3067\u307e\u3068\u3081\u307e\u3057\u305f\u306e\u3067\u3053\u3061\u3089\u3082\u3042\u308f\u305b\u3066\u3069\u3046\u305e\u3002<\/p>\n<p><a href=\"https:\/\/www.ecoop.net\/memo\/archives\/guide-for-pem.html\" target=\"_blank\">[OpenSSL] pem \u30d5\u30a1\u30a4\u30eb\u3068\u306f\uff1f\u8a3c\u660e\u66f8\u306e\u4e2d\u8eab\u3092\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5<\/a><\/p>\n<p>p12\u30d5\u30a1\u30a4\u30eb\u3092\u306a\u304f\u3057\u305f\u6642\u306a\u3069\u306b\u4f7f\u3048\u308b\u3001\u8a3c\u660e\u66f8\u3001\u79d8\u5bc6\u9375\u304b\u3089\uff50\uff11\uff12\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308b\u65b9\u6cd5\u306f\u3053\u3061\u3089\u306b\u66f8\u304d\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/www.ecoop.net\/memo\/archives\/convert-private-key-and-cert-to-p12.html\" target=\"_blank\">\u8a3c\u660e\u66f8\u3068\u79d8\u5bc6\u9375\u304b\u3089p12\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308b<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>iOS\u958b\u767a\u3067\u983b\u7e41\u306b\u304a\u4e16\u8a71\u306b\u306a\u308b .p12 \u30d5\u30a1\u30a4\u30eb(\u79d8\u5bc6\u9375\uff0b\u8a3c\u660e\u66f8\u306e\u30bb\u30c3\u30c8)\u306e\u60c5\u5831\u3092\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002 SHA1\u30d5\u30a3\u30f3\u30ac\u30fc\u30d7\u30ea\u30f3\u30c8\u3001\u6709\u52b9\u671f\u9650\u3001\u30c1\u30fc\u30e0ID,\u540d\u524d\u306a\u3069\u304c\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u7c21\u5358\u306b\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117,101,84],"tags":[145,116,147,144,146],"class_list":["post-1197","post","type-post","status-publish","format-standard","hentry","category-ios-dev","category-mac-2","category-spdev","tag-apple","tag-ios","tag-openssl","tag-p12","tag-certification"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/1197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/comments?post=1197"}],"version-history":[{"count":0,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/1197\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/media?parent=1197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/categories?post=1197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/tags?post=1197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}