It is not part of the default install of OS X and must be installed manually.
To generate a new key pair:
gpg --gen-keyTo list keys on your public keyring:
gpg --list-keysTo list keys on your secret keyring:
gpg --list-secret-keysTo encrypt a text file "message.txt" for recipient "foo" with ASCII armor (Base64):
gpg -e -a -r foo message.txtThe encrypted message is saved as file "message.txt.asc".
To encrypt a text file "message.txt" for recipient "foo" with ASCII armor and sign it with your secret key:
gpg -s -e -a -r foo message.txtTo import a public key:
gpg --import keyfileTo sign a newly imported key with your secret key:
gpg --sign-key keynameTo delete a public key from the keyring:
gpg --delete-key keynameTo verify a file with a detached signature:
gpg --verify signature data-fileTo import a public key:
gpg --import keyfileSet up a trusted public key (no passphrase required):
If you want to encrypt files in a script and not be prompted for your passphrase, you need to sign all public keys you want to use. Follow this procedure (GPG 1.2.5+) to sign a public key.
gpg --edit-key keyname- at the prompt, enter "trust"
- select "4" for trust fully
- enter "lsign" to locally sign it
- at the prompt, enter 3 for very careful checking
- answer "yes" to the the "Really Sign?" prompt
- enter secret key passphrase when requested
- enter "save"