Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:convertir_un_certificat_de_pkcs12_en_pem_format_ou_vice-versa [2016/12/16 10:16] (current)
Line 1: Line 1:
 +Last modified: Sep 10, 2008 by Calas\\
 +\\
 +
 +====== Convert a certificate from PKCS12/PEM to PEM/PKCS12 format ======
 +
 +\\
 +\\
 +
 +=====  Conversion from PKCS12 to PEM  =====
 +
 +To get the private key in the file ~user/​.globus/​userkey.pem:​
 +<​code>​
 +> openssl pkcs12 ​ -nocerts -in cert.p12 -out ~user/​.globus/​userkey.pem
 +</​code>​
 +To get the certificate in the file ~user/​.globus/​usercert.pem:​
 +<​code>​
 +> openssl pkcs12 -clcerts ​ -nokeys -in cert.p12 -out ~user/​.globus/​usercert.pem ​
 +</​code>​
 +=====  Check (and change) file modes  =====
 +
 +<​code>​
 +chmod 0600 userkey.pem
 +chmod 0644 usercert.pem
 +</​code>​
 +=====  Read the content of a certificate ​ =====
 +
 +Use te openssl command to read the content of a certificate:​
 +<​code>​
 +> openssl x509 -text -noout -in usercert.pem
 +</​code>​
 +=====  Conversion from PEM to PKCS12 ​ =====
 +
 +If the certificate can be found in usercert.pem and if the private key can be found in userkey.pem,​ it is possible to generate a PKCS12 file named certif.p12 from these two files using the following command:
 +<​code>​
 +> openssl pkcs12 -export -out certif.p12 -inkey userkey.pem -in usercert.pem
 +</​code>​
 +
  
  • en/convertir_un_certificat_de_pkcs12_en_pem_format_ou_vice-versa.txt
  • Last modified: 2016/12/16 10:16
  • (external edit)