Roman-Sky
4/2/2016 - 2:50 PM

work with gnupg (gpg) keys

# generate key
gpg --gen-key

# generate revocation certificate
gpg --output ~/key_revoke.asc --gen-revoke mykey
# mykey is key ID or part of user ID

# list of installed keys
gpg --list-keys

# export public key
gpg --output ~/key_public.gpg --armor --export mykey

# export private key
gpg --output ~/key_private.gpg --armor --export-secret-key mykey

# import public key
gpg --import ~/key_public.gpg

# import private key
gpg --allow-secret-key-import --import ~/key_private.gpg

# decrypt file
gpg --output doc --decrypt doc.gpg