1、列出系统中已有的密钥
gpg –list-keys
2、导入密钥
gpg –import filepath
3、加密
gpg -r TOM\&JERR [-r JACK] -o testgpg.en.txt -e testgpg.txt
4、解密,注意 输出必须在前面
gpg -o tt.txt -d testgpg.en.txt
5、签名 gpg二进制格式
gpg -r TOM\&JERRY –sign testgpg.txt
6、签名 文本 asc格式
gpg –clearsign testgpg.txt
7、生成单独的签名文件
gpg –detach-sign testgpg.txt
8、生成单独的文本签名文件
gpg –armor –detach-sign testgpg.txt
9、验证
gpg –verify testgpg.txt.gpg
10、签名+加密
gpg -u TOM\&JERRY -r TOM\&JERRY –armor –sign –encrypt testgpg.txt
11、验证签名
gpg –verify testgpg.txt.sig
12、从加密文件中读取原始文件信息
gpg –list-packets oo