gpg signature

1.create a file called /root/.gnupg/S.gpg-agent.

[root@amd-4450b-4-1 ~]# gpg-agent --daemon --use-standard-socket
gpg-agent[26318]: directory `/home/fedora16/.gnupg' created
gpg-agent[26318]: directory `/home/fedora16/.gnupg/private-keys-v1.d' created
GPG_AGENT_INFO=/home/fedora16/.gnupg/S.gpg-agent:26319:1; export GPG_AGENT_INFO;
gpg-agent[26319]: gpg-agent (GnuPG) 2.0.18 started

2.create gpg keys.

[root@amd-4450b-4-1 ~]# gpg --gen-key

3.create rpmmacros file

[root@amd-4450b-4-1 ~]# echo  %_signature pgp>~/.rpmmacros

[root@amd-4450b-4-1 ~]# echo %_gpg_name abcd (redhat)>>~/.rpmmacros

4. resign for rpm

[root@amd-4450b-4-1 ~]# rpm --resign /tmp/var/zsh-4.3.11-2.fc15.x86_64.rpm

5.verify rpm signature

[root@amd-4450b-4-1 ~]# rpm -K /var/zsh-4.3.11-2.fc15.x86_64.rpm
/var/zsh-4.3.11-2.fc15.x86_64.rpm: rsa sha1 (md5) pgp md5 OK

[root@amd-4450b-4-1 ~]# rpm -K /tmp/var/zsh-4.3.11-2.fc15.x86_64.rpm
/tmp/var/zsh-4.3.11-2.fc15.x86_64.rpm: RSA sha1 ((MD5) PGP) md5 NOT OK (MISSING KEYS: (MD5) PGP#44d090c9)


reference  http://hi.baidu.com/boydir/blog/item/076224dd570aa5dd8c1029fd.html


你可能感兴趣的:(保密安全性)