Skip to main content
Deftone
New Member
December 21, 2016
Question

Export certificate PFX/P12

  • December 21, 2016
  • 1 reply
  • 27316 views

Hello,

 

I just wondering how I can export certificate as PEM or PFX/P12.

I need it because without the private key i can not use certificate based authentication on my iPhone.

 

Importing only the certificate with root certificates does not allow me to use the certificate for the vpn on my iPhone.

 

 

 

    1 reply

    emnoc
    New Member
    December 21, 2016

    Export it from what format?

     

    The unix/windows openssl is what i would use, it has numerous examples for exporting windows pfx format to CERT and KEY format

     

    e.g

    openssl pkcs12 -in webserver.pfx -out webservercertkey.pem
    openssl pkcs12 -in webserver.pfx -out webservercer.pem -nokeys

    openssl rsa -in webserverkey.pem -aes128 -out justmykey.key
    openssl rsa -in webserverkey.pem   -out justmykeynopass.key

    Than if you want to bundle the two  cat webservercer.pem justmykeynopass.key >>bundle.pem

     

     

    Deftone
    DeftoneAuthor
    New Member
    December 21, 2016
    From installed certificate on my Fortigate. I created csr on the Fortigate to buy an certificate. Now once certificate installed I want to export to PEM or PFX/P12.
    Deftone
    DeftoneAuthor
    New Member
    December 21, 2016

    OK I found my certificate and private key under::

     

    config vpn certificate local

     

    Now when I try to combine them with openssl I'm getting question about phrase

     

     

    OpenSSL> pkcs12 -inkey vpn.key -in vpn.cer -export -out vpn_pfx.pfx Loading 'screen' into random state - done Enter pass phrase for vpn.key:

     

    I did not givup any phrase when I was importing certificate into the fortigate

    Also no phraase was created while creating csr

     

    When I try to unset password I get en error

     

    #### (vpn) # unset password Certificate 'vpn' is not allowed to unset. Command fail. Return code -14

     

    Any idea?