标签: gpg

  • GPG 加密文件

    生成密钥:       gpg   --gen-key
    
    列出公钥:       gpg  --list-keys
    
    列出私钥:       gpg  --list-secret-keys
    
    导出公钥:       gpg  [-a]  -o key.pub  --export  [ID]
    
    导出私钥:       gpg  [-a] -o key.priv    --export-secret-key [ID]
    
    公布公钥:       gpg  --send-keys   ID
    
    搜索公钥:       gpg --search-keys  [ID or Name]
     
    检查公钥:        gpg  --fingerprint    [ID]
    
    导入公钥:     gpg        --import   key.pub
    导入私钥:     gpg        --import   key,priv
    
    
    
    加密文件:  
                          test.txt  ==> test.txt.asc     
                             gpg  -e -a -r zhenglei test.txt
                          
                          test.txt  ==> test.txt.pgp
                             gpg  -e -r zhenglei test.txt
    
    
    解密文件:
              gpg  -d   test.txt.asc
              gpg  -o   test.txt    -d  test.txt.asc 
              
              gpg  -d   test.txt.gpg
              gpg  -o   test.txt   -d  test.txt.gpg
    
    
    ===============================================
    签名:  
         x1 ==> x1.gpg
              gpg -s x1
    
       x1 ==>  x1.asc
              gpg --clearsign x1
    
      x1  ==>  x1 + x1.sig 
            gpg -b x1
    
    
      x1  ==> x1 + x1.asc
            gpg -a -b x1
    
    
     验证签名:
         gpg   --verify   x1.asc
         gpg   --verify   x1.sig
         gpg   --verify   x1.gpg
    
    
    
    加密并签名
       gpg  [-u Sender]    [-r Recipient ]   [-a]  -s -e  filename
    
    解密并验证:
      gpg  -d  filename.asc
    
    
    
    http://www.oschina.net/translate/pgp-tutorial
    http://www.huangwei.me/blog/2010/10/25/gnupg-quickstart/