gpg --list-keys #list all keys
gpg --list-keys 1234ABCD123 #list this specific key
gpg --encrypt -r recipient@example.com > mysecretfile #encrypt mysecretfile with recipients associated key
gpg --decrypt < mysecretfile #decrypt obviosly
openssl x509 -noout -text -in name.crt
openssl x509 -noout -text -in name.crt.chained
openssl genrsa -out key.txt 2048 #Generate a 2048-bit RSA key and store it in key.txt
echo "Hello!" | openssl rsautl -inkey key.txt -encrypt > output.bin #Encrypt "Hello!" using the key
openssl rsautl -inkey key.txt -decrypt <output.bin #Decrypt the message
#Generate a private/public key pair
openssl genrsa -out rsa_key.pri 2048; openssl rsa -in rsa_key.pri -out rsa_key.pub -outform PEM -pubout
#Encrypt the string using public key, and store in a file
echo "stockexchange.com" | openssl rsautl -encrypt -inkey rsa_key.pub -pubin -out secret.dat
#Un-encrypt using private key
string=`openssl rsautl -decrypt -inkey rsa_key.pri -in secret.dat `; echo $string
stockexchange.com