"GPG Key 생성"의 두 판 사이의 차이

54번째 줄: 54번째 줄:
[root@jmnote ~]# gpg --export-secret-keys -a 'example' > MY-RPM-GPG-KEY.secret
[root@jmnote ~]# gpg --export-secret-keys -a 'example' > MY-RPM-GPG-KEY.secret
</source>
</source>
<source lang='dos'>
[root@jmnote ~]# pkill gpg-agent
gpg-agent[2535]: SIGTERM received - shutting down ...
gpg-agent[2535]: gpg-agent (GnuPG) 2.0.14 stopped
</source>
==확인==
<source lang='dos'>
<source lang='dos'>
[root@jmnote ~]# cat MY-RPM-GPG-KEY.pub
[root@jmnote ~]# cat MY-RPM-GPG-KEY.pub

2014년 4월 21일 (월) 11:43 판

generate gpg key
GPG KEY 생성
GPG 공개키 개인키 생성

1 명령어

rngd -r /dev/urandom
gpg-agent --use-standard-socket --daemon
cat <<EOF | gpg --batch --no-tty --gen-key
%echo Generating a standard key
Key-Type: default
Key-Length: 2048
Subkey-Type: default
Subkey-Length: 2048
Name-Real: example
Name-Email: example@example.com
Expire-Date: 0
Passphrase: secret
%commit
%echo done
EOF
gpg --export -a 'example' > /vagrant/modules/usemyrepo/files/MY-RPM-GPG-KEY.pub
gpg --export-secret-keys -a 'example' > /vagrant/modules/rpmbuild/files/MY-RPM-GPG-KEY.secret

2 실행예시

[root@jmnote ~]# rngd -r /dev/urandom
[root@jmnote ~]# gpg-agent --use-standard-socket --daemon
gpg-agent[2534]: directory `/root/.gnupg/private-keys-v1.d' created
gpg-agent[2535]: gpg-agent (GnuPG) 2.0.14 started
GPG_AGENT_INFO=/root/.gnupg/S.gpg-agent:2535:1; export GPG_AGENT_INFO;
[root@jmnote ~]# cat <<EOF | gpg --batch --no-tty --gen-key
> %echo Generating a standard key
> Key-Type: default
> Key-Length: 2048
> Subkey-Type: default
> Subkey-Length: 2048
> Name-Real: example
> Name-Email: example@example.com
> Expire-Date: 0
> Passphrase: secret
> %commit
> %echo done
> EOF
gpg: Generating a standard key
gpg: key 3110D314 marked as ultimately trusted
gpg: done
[root@jmnote ~]# gpg --export -a 'example' > MY-RPM-GPG-KEY.pub
[root@jmnote ~]# gpg --export-secret-keys -a 'example' > MY-RPM-GPG-KEY.secret
[root@jmnote ~]# pkill gpg-agent
gpg-agent[2535]: SIGTERM received - shutting down ...
gpg-agent[2535]: gpg-agent (GnuPG) 2.0.14 stopped

3 확인

[root@jmnote ~]# cat MY-RPM-GPG-KEY.pub
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.14 (GNU/Linux)

mQENBFNUhEoBCAC1v7pwnpWfikT3r+SgPAgtOlj5MfcnW0EHGrX/YbxQY4xLYX9/
KXbrTEW0RDsssfs9aCH0yJXxDtNfLfuwCUk9D1scElG45UMF0hPy0vrNY4Fs+rxp
...(생략)
7unk3w9WaHrEN+ztugMUvQaxn1iR7ug/OeukuXqbfEUvdYnoC3S2BZjRXoZOBSdW
fMkjgc0B5i0S6G+fymnwtOtEGWJ/CygoLHIk1w==
=wPaT
-----END PGP PUBLIC KEY BLOCK-----
[root@jmnote ~]# cat MY-RPM-GPG-KEY.secret 
-----BEGIN PGP PRIVATE KEY BLOCK-----
Version: GnuPG v2.0.14 (GNU/Linux)

lQO+BFNUhEoBCAC1v7pwnpWfikT3r+SgPAgtOlj5MfcnW0EHGrX/YbxQY4xLYX9/
KXbrTEW0RDsssfs9aCH0yJXxDtNfLfuwCUk9D1scElG45UMF0hPy0vrNY4Fs+rxp
... (생략)
FL0GsZ9Yke7oPznrpLl6m3xFL3WJ6At0tgWY0V6GTgUnVnzJI4HNAeYtEuhvn8pp
8LTrRBlifwsoKCxyJNc=
=C7xF
-----END PGP PRIVATE KEY BLOCK-----

4 같이 보기

5 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}