Advertisement
flycat

openssl

Sep 8th, 2016 (edited)
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.61 KB | None | 0 0
  1. # PEM в DER
  2. openssl x509 -outform der -in certificate.pem -out certificate.der
  3. # PEM в P7B
  4. openssl crl2pkcs7 -nocrl -certfile certificate.cer -out certificate.p7b -certfile CACert.cer
  5. # PEM в PFX
  6. openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt
  7.  
  8. # II. Конвертирование файлов P7B
  9. # P7B в PEM
  10. openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer
  11. # P7B в PFX
  12. openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer openssl pkcs12 -export -in certificate.cer -inkey privateKey.key -out certificate.pfx -certfile CACert.cer
  13.  
  14. # III. Конвертирование файлов PFX
  15. # PFX в PEM
  16. openssl pkcs12 -in certificate.pfx -out certificate.cer -nodes
  17.  
  18. # IV. Конвертирование файлов DER
  19. # DER в PEM
  20. openssl x509 -inform der -in certificate.cer -out certificate.pem
  21.  
  22. # OpenSSL client
  23. openssl s_client -connect example.com:443 -ssl3
  24. echo | openssl s_client -servername NAME -connect HOST:PORT 2>/dev/null | openssl x509 -noout -dates
  25.  
  26. openssl s_client -showcerts -connect mail.example.com:993
  27.  
  28. # With specific protocol
  29. openssl s_client -connect zabbix-a.itvx.cf:443 -tls1_1
  30.  
  31. # View date of cert
  32. openssl x509 -enddate -noout -in file.pem
  33.  
  34. # View ciphers
  35. openssl ciphers
  36.  
  37. # Generate key:
  38. openssl genrsa -out server.key 4096
  39.  
  40. # Generate csr:
  41. openssl req -config ./openssl.cnf -out client/client06/client06.csr -key client/client06/client06.key -new
  42.  
  43. # Sign csr:
  44. openssl x509 -days 365 -in myCSR.csr -extfile v3.ext -CA myCA.crt -CAkey myCA.key -CAcreateserial -out userCertificate.crt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement