Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt getting client certificates from OS certificate store.

Qt getting client certificates from OS certificate store.

Scheduled Pinned Locked Moved General and Desktop
9 Posts 4 Posters 9.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sargsyan.taron
    wrote on last edited by
    #1

    Hi,

    Another exhausting problem for me. I tried to find way how to get clients certificates from OS with Qt API. I was unable to find any references from google.

    I have certificate issued for client and I will use it to authenticate client. I need to find way to get that from OS store. Windows stores them in its own structure(personal) look at Microsoft store description , in unix based OSes they are located under /etc/ca...

    I'm using Qt 4.7 , OS: windows, MAC Language is: C++

    Thanks Best Regards Taron Sargsyan

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      And what have you tried already? What do you need help on exactly?
      I have not tried this myself, but you should be able to access certificates in the store using windows API's. Did you have a look at that?

      http://msdn.microsoft.com/en-us/library/aa380252(v=vs.85).aspx#certificate_and_certificate_store_functions

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sargsyan.taron
        wrote on last edited by
        #3

        Hi Andre

        Not for now,

        I'm trying to find some cross-platform solution, I hope that Qt has solution for this. Qt can get all CA certificates of OS(QList QSslConfiguration::caCertificates ()) so I supposed that it will be able also to get clients personal certificates.
        My application should run on Windows, MACOSX and Linux so handling each case separately will complicate things.

        Thanks
        Best Regards
        Taron Sargsyan

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sargsyan.taron
          wrote on last edited by
          #4

          What I'm exactly trying to do is:

          I'm opening QWebView and loading https://xxx.xx.xx which requires from client to pass p12 certificate.
          All browsers displaying list of clients certificates and asking to choose one for use. QWebView doesn't handling this case.

          maybe there are way to tell QWebView to handle this case ?

          Thanks
          Best Regards
          Taron Sargsyan

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sargsyan.taron
            wrote on last edited by
            #5

            PPL please give me some tips...

            Is there any qt implementation for windows http://msdn.microsoft.com/en-us/library/aa380252(v=vs.85).aspx#certificate_store_functions API and MACOSX http://developer.apple.com/library/mac/#documentation/Security/Reference/keychainservices/Reference/reference.html#//apple_ref/doc/uid/TP30000898 services ????

            this is urgent!

            Thanks in advance

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              There is no such API yet, you will have to write your own solution.

              If you want to - and are legally allowed to - you might put your solution onto the wiki.

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • S Offline
                S Offline
                sargsyan.taron
                wrote on last edited by
                #7

                Hi Volker

                Thanks for answer.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sargsyan.taron
                  wrote on last edited by
                  #8

                  OK I managed to compile WINAPI libs with headers with QT and also able to get client certificates.

                  please check code below :

                  @ PQNetworkAccessManager* manager=new PQNetworkAccessManager(&app);
                  QWebView web;
                  web.page()->setNetworkAccessManager(manager);
                  QNetworkRequest* request=new QNetworkRequest();
                  request->setUrl(QUrl("https://someservice"));
                  QSslConfiguration config=request->sslConfiguration();
                  CertificateManagmentWIN win;
                  config.setLocalCertificate(win.getCertificatesList().at(0));
                  request->setSslConfiguration(config);
                  web.load(*request);
                  web.show();@

                  PQNetworkAccessManager is class which extended from QNetworkAccessManager and just ignoring ssl errors.

                  My problem now is that seems that client certificate not reaching server.

                  Any help will be appreciated

                  Thanks in advance
                  Taron Sargsyan

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    sinotitan
                    wrote on last edited by
                    #9

                    maybe need rebuild qt with openssl。but openssl need provide certificate private key,so smarkcard(usbkey) maybe not supported.

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved