Package: self-signed
self-signed: Create self signed certificates with multiple Domain Names (SANs) with styleself-signed is a python tool to make it easy to generate self signed certificates with multiple domain names (SAN - Subject Alternative Names).While it is relatively simple to generate a self signed certificate for a single domain name with the openssl shell, creating one for multiple domain names issignifficantlyharder. You have to create / change configuration files for that, something I always forgot and had to look up. Doubly so, if you want to support utf8 names in there. Also, theopensslshell is just not really a nice and focused experience to create self signed certificates.That is where this package helps, one command, nice--helpoutput and a job quickly done.What does this tool do?It allows you to create a certificate request with multiple SANsIt allows you to optionally self sign that requestSets the right defaults to create certificate signing requests and certificates with utf8 fieldsDemo time%opensslgenrsa-outprivate.key4096GeneratingRSAprivatekey,4096bitlongmodulus
......................................................................................................................................................................................................................................................................................................................++
.....++
eis65537(0x10001)%self-signed--batch--keyprivate.key--csr-outrequest.pem--certificate-outcertificate.pem--domainsfoo.example.combar.example.com-v# openssl req -new -sha256 -key private.key -reqexts SAN -config /path/to/generated/config -batch -out request.pem# openssl x509 -req -sha256 -days 365 -extfile /path/to/generated/config -in request.pem -signkey private.key -nameopt oneline,-esc_msb -out certificate.pemSignatureoksubject=C=DE,ST=Berlin,L=Berlin,O=Häckertools,OU=DevOps,CN=foo.example.com,emailAddress=haecker@example.com
GettingPrivatekey
%self-signed--introspectprivate.key|head# openssl rsa -in private.key -noout -textPrivate-Key:(4096bit)modulus:00:da:8a:ad:19:fe:fc:3e:66:b2:87:d9:9f:39:05:2b:0f:b6:37:f9:68:91:32:ff:75:bf:85:0f:2d:8e:6d:08:da:01:82:44:7e:c2:aa:bd:21:c8:79:ea:f1:66:1d:90:8d:2b:c6:40:cc:21:7c:b7:bd:f2:77:86:8b:1b:0d:9c:6b:3e:15:6a:74:af:5b:19:0d:94:b6:cf:df:b9:e6:3b:45:cf:e5:26:f9:d6:88:28:80:8c:4e:8f:3b:45:7d:23:df:bf:e5:15:44:25:b6:d1:ef:8f:13:15:43:10:6e:28:3d:3d:61:0b:b8:2c:6a:47:
%self-signed--introspectrequest.pem|head# openssl req -in request.pem -noout -text -nameopt oneline,-esc_msbCertificateRequest:Data:Version:0(0x0)Subject:C=DE,ST=Berlin,L=Berlin,O=Häckertools,OU=DevOps,CN=foo.example.com,emailAddress=haecker@example.comSubjectPublicKeyInfo:PublicKeyAlgorithm:rsaEncryptionPublic-Key:(4096bit)Modulus:00:da:8a:ad:19:fe:fc:3e:66:b2:87:d9:9f:39:05:2b:0f:b6:37:f9:68:91:32:ff:75:bf:85:0f:2d:8e:
%self-signed--introspectcertificate.pem|head-n15# openssl x509 -in certificate.pem -noout -text -nameopt oneline,-esc_msbCertificate:Data:Version:3(0x2)SerialNumber:10970618610503198012(0x983f77805d55253c)SignatureAlgorithm:sha256WithRSAEncryptionIssuer:C=DE,ST=Berlin,L=Berlin,O=Häckertools,OU=DevOps,CN=foo.example.com,emailAddress=haecker@example.comValidityNotBefore:Oct2908:50:522021GMTNotAfter:Oct2908:50:522022GMTSubject:C=DE,ST=Berlin,L=Berlin,O=Häckertools,OU=DevOps,CN=foo.example.com,emailAddress=haecker@example.comSubjectPublicKeyInfo:PublicKeyAlgorithm:rsaEncryptionPublic-Key:(4096bit)Modulus:00:da:8a:ad:19:fe:fc:3e:66:b2:87:d9:9f:39:05: