https://lemyst.github.io/posts/manipulate-certificates/
Manipulating Certificates with OpenSSL - LeMyst