Create a new private key/public key/pkcs12 with openssl


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. openssl genrsa -des3 -out my-cert.key 2048
  2.  
  3. openssl req -new -key my-cert.key -out my-cert.csr
  4.  
  5. copy my-cert.key my-cert.key.orig
  6.  
  7. openssl rsa -in my-cert.key.orig -out my-cert.key
  8.  
  9. openssl x509 -req -days 3650 -in my-cert.csr -signkey my-cert.key -out my-cert.crt
  10.  
  11. openssl pkcs8 -topk8 -nocrypt -in my-cert.key -inform PEM -out my-cert-key.der -outform DER
  12.  
  13. openssl x509 -in my-cert.crt -inform PEM -out my-cert-crt.der -outform DER
  14.  
  15. openssl pkcs12 -export -in my-cert.crt -inkey my-cert.key -out my-cert.p12 -name "My Certificate"

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.