{"id":254743,"date":"2014-08-14T18:15:38","date_gmt":"2014-08-14T10:15:38","guid":{"rendered":"http:\/\/blog.zhenglei.net\/?p=254743"},"modified":"2014-10-15T16:01:40","modified_gmt":"2014-10-15T08:01:40","slug":"gpg-%e5%8a%a0%e5%af%86%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/blog.zhenglei.net\/?p=254743","title":{"rendered":"GPG \u52a0\u5bc6\u6587\u4ef6"},"content":{"rendered":"<pre class=\"bash\" style=\"font-family: monospace\"><span style=\"color: #660033\">\u751f\u6210\u5bc6\u94a5\uff1a \u00a0 \u00a0 \u00a0 gpg   --gen-key\r\n\r\n\u5217\u51fa\u516c\u94a5\uff1a \u00a0 \u00a0 \u00a0 gpg  --list-keys\r\n\r\n\u5217\u51fa\u79c1\u94a5\uff1a \u00a0 \u00a0 \u00a0 gpg  --list-secret-keys\r\n\r\n\u5bfc\u51fa\u516c\u94a5\uff1a \u00a0 \u00a0 \u00a0 gpg  [-a]  -o key.pub  --export  [ID]\r\n\r\n\u5bfc\u51fa\u79c1\u94a5\uff1a \u00a0 \u00a0 \u00a0 gpg  [-a] -o key.priv    --export-secret-key [ID]\r\n\r\n\u516c\u5e03\u516c\u94a5\uff1a \u00a0 \u00a0 \u00a0 gpg  --send-keys   ID\r\n\r\n\u641c\u7d22\u516c\u94a5\uff1a \u00a0 \u00a0 \u00a0 gpg --search-keys  [ID or Name]\r\n \r\n\u68c0\u67e5\u516c\u94a5\uff1a \u00a0 \u00a0 \u00a0 \u00a0gpg  --fingerprint    [ID]\r\n<\/span><\/pre>\n<pre><span style=\"color: #660033\">\u5bfc\u5165\u516c\u94a5\uff1a \u00a0 \u00a0 gpg        --import   key.pub\r\n\u5bfc\u5165\u79c1\u94a5\uff1a \u00a0 \u00a0 gpg        --import   key,priv\r\n\r\n\r\n\r\n\u52a0\u5bc6\u6587\u4ef6\uff1a  \r\n                      test.txt  ==&gt; test.txt.asc \u00a0 \u00a0 \r\n                         gpg  -e -a -r zhenglei test.txt\r\n                      \r\n                      test.txt  ==&gt; test.txt.pgp\r\n                         gpg  -e -r zhenglei test.txt\r\n\r\n\r\n\u89e3\u5bc6\u6587\u4ef6\uff1a\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 gpg  -d   test.txt.asc\r\n          gpg  -o   test.txt    -d  test.txt.asc \r\n          \r\n          gpg  -d   test.txt.gpg\r\n          gpg  -o   test.txt   -d  test.txt.gpg\r\n\r\n\r\n===============================================\r\n\u7b7e\u540d\uff1a \u00a0\r\n     x1 ==&gt; x1.gpg\r\n\u00a0 \u00a0    \u00a0 \u00a0gpg -s x1\r\n\r\n   x1 ==&gt;  x1.asc\r\n          gpg --clearsign x1\r\n\r\n  x1  ==&gt;  x1 + x1.sig \r\n        gpg -b x1\r\n\r\n\r\n  x1  ==&gt; x1 + x1.asc\r\n        gpg -a -b x1\r\n\r\n\r\n \u9a8c\u8bc1\u7b7e\u540d\uff1a\r\n\u00a0 \u00a0 \u00a0gpg   --verify   x1.asc\r\n     gpg   --verify   x1.sig\r\n     gpg   --verify   x1.gpg\r\n\r\n\r\n\r\n\u52a0\u5bc6\u5e76\u7b7e\u540d\r\n\u00a0 \u00a0gpg  [-u Sender]    [-r Recipient ]   [-a]  -s -e  filename\r\n\r\n\u89e3\u5bc6\u5e76\u9a8c\u8bc1\uff1a\r\n\u00a0 gpg  -d  filename.asc\r\n<\/span><\/pre>\n<pre class=\"bash\" style=\"font-family: monospace\"><\/pre>\n<pre class=\"bash\" style=\"font-family: monospace\"><span style=\"color: #660033\"><a title=\"GNU\u9690\u79c1\u6743\u4fdd\u62a4\u52a0\u5bc6\u7cfb\u7edf GPG \u5feb\u901f\u5165\u95e8 \" href=\"\/\/www.oschina.net\/translate\/pgp-tutorial\" target=\"_blank\">http:\/\/www.oschina.net\/translate\/pgp-tutorial<\/a>\r\n<a title=\"GnuPG\u5feb\u901f\u5165\u95e8\u6559\u7a0b\u6c47\u7f16\" href=\"http:\/\/www.huangwei.me\/blog\/2010\/10\/25\/gnupg-quickstart\/\" target=\"_blank\">http:\/\/www.huangwei.me\/blog\/2010\/10\/25\/gnupg-quickstart\/<\/a>\r\n<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u751f\u6210\u5bc6\u94a5\uff1a \u00a0 \u00a0 \u00a0 gpg &#8211;gen-key \u5217\u51fa\u516c\u94a5\uff1a \u00a0 \u00a0 \u00a0 gp &hellip; <a href=\"https:\/\/blog.zhenglei.net\/?p=254743\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[147],"class_list":["post-254743","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-gpg"],"_links":{"self":[{"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/posts\/254743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=254743"}],"version-history":[{"count":7,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/posts\/254743\/revisions"}],"predecessor-version":[{"id":254877,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/posts\/254743\/revisions\/254877"}],"wp:attachment":[{"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=254743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=254743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=254743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}