Skip to content

Instantly share code, notes, and snippets.

View 4c74356b41's full-sized avatar
💭
zlpplz

Gleb Boushev 4c74356b41

💭
zlpplz
View GitHub Profile
@codingoutloud
codingoutloud / make-keys.bat
Last active August 3, 2023 19:05
Handy OpenSSL command-line combinations I've used - they might've been hard to find or come up with, so capturing them here.
@echo off
if _%1_==__ goto USAGE
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem -subj "/CN=My Cert Name"
openssl pkcs12 -export -out mycert.pfx -inkey mycert.pem -in mycert.pem -passout pass:%1
openssl x509 -inform pem -in mycert.pem -outform der -out mycert.cer
openssl pkcs12 -in mycert.pfx -nodes -passin pass:%1 | openssl x509 -noout -fingerprint
openssl x509 -in mycert.pem -noout -fingerprint
#!/bin/bash
# the source: http://serverfault.com/questions/515833/how-to-remove-private-key-password-from-pkcs12-container
if [ $# -ne 2 ]
then
echo "Usage: `basename $0` YourPKCSFile YourPKCSPassword"
exit $E_BADARGS
fi