Results 1 to 4 of 4

Thread: [Certificate] How can I import/read the client/ intermediate certificate

  1. #1
    Join Date
    Oct 2012
    Posts
    12

    Question [Certificate] How can I import/read the client/ intermediate certificate

    Hi, everyone,

    I know qt has API to manage the CA certificate, but I do not find any API to handle the manage the client/ intermediate certificates.
    Does anyone has implement the import/ read the client/ intermediate certificate? Please give me advise. Thank you very much!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,641
    Thanks
    13
    Thanked 1,592 Times in 1,520 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: [Certificate] How can I import/read the client/ intermediate certificate

    QSslSocket::setLocalCertificate() sets the client certificate for those occasions it is required.

    I would guess that intermediate CA certificates should be placed in the CA certificate store. They are checked recursively up to a limited depth (See QSslSocket::setPeerVerifyDepth()) although unlimited by default.

  3. #3
    Join Date
    Oct 2012
    Posts
    12

    Default Re: [Certificate] How can I import/read the client/ intermediate certificate

    Quote Originally Posted by ChrisW67 View Post
    QSslSocket::setLocalCertificate() sets the client certificate for those occasions it is required.

    I would guess that intermediate CA certificates should be placed in the CA certificate store. They are checked recursively up to a limited depth (See QSslSocket::setPeerVerifyDepth()) although unlimited by default.
    Thank you very much. I guess the local certiciate is client certificate. But I find that qt do not support .p12 format of certificate.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,641
    Thanks
    13
    Thanked 1,592 Times in 1,520 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: [Certificate] How can I import/read the client/ intermediate certificate

    Then use a tool to convert the PKCS12 file to PEM format. OpenSSL will do this for you with something like:
    Qt Code:
    1. openssl pkcs12 -in cred.p12 -out certkey.pem -nodes -clcerts
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. save ssl certificate to file
    By vinas003 in forum Qt Programming
    Replies: 2
    Last Post: 13th September 2012, 10:47
  2. QSslSocket, certificate and error
    By ithanoss in forum Newbie
    Replies: 2
    Last Post: 26th May 2011, 17:20
  3. Generating key and certificate for QSslSocket
    By dawwin in forum Qt Programming
    Replies: 7
    Last Post: 27th March 2011, 14:12
  4. Qt getting client certificates from OS certificate store.
    By sargsyan.taron in forum Qt Programming
    Replies: 0
    Last Post: 16th February 2011, 16:39
  5. Symbian - self-signed certificate
    By metRo_ in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 10th March 2010, 06:10

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.