Java Security Library Utils
You can create pub.pem, key.pem and cert.pem with maven autocert plugin or with openssl.
Openssl
$ nano openssl.conf
[req]
distinguished_name = req_distinguished_name
# req_extensions = v3_req
prompt = no
[req_distinguished_name]
C = Country
ST = Stade
L = Locale
O = Organization
OU = O
CN = www.domain.com
RSA
$ openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -sha256 -config openssl.conf -passout pass:Abcd123.,# -nodes
EC
$ openssl ecparam -name secp521r1 -genkey -noout -out key1.pem
$ openssl req -new -x509 -sha256 -key key1.pem -out cert.pem -config openssl.conf
$ openssl pkcs8 -topk8 -nocrypt -in key1.pem -out key.pem && rm key1.pem
License
GPL-3.0 © Yadickson Soto