Created
February 15, 2018 00:54
-
-
Save boxrick/2045843f4775cadba54f13101c58233c to your computer and use it in GitHub Desktop.
Open SSL smime Cert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generating a pub cert from your private key ( This is going to be stored inside Ansible mist under each user ) | |
openssl req -x509 -new -key ~/.ssh/id_rsa -nodes -subj "/C=GB/ST=*/L=*/O=*/OU=*/CN=NAMEHERE/" | |
Encrypting some data against the above key(s) | |
echo STRINGTOENCRYPT | openssl smime -encrypt -aes256 -outform PEM /tmp/rick.CERT /tmp/james.CERT /tmp/stuartgr.CERT | |
Decrypting data | |
openssl smime -decrypt -in /tmp/ONDISKENCRYPTEDSTRINGFILE -inform PEM -inkey ~/.ssh/id_rsa | |
^^ can also be fed from stdin as per encrypting line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment