Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    QCA win32 pgp keys problem

    General and Desktop
    3
    10
    2273
    Loading More Posts
    • 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.
    • D
      Dmitry A last edited by

      Hello. I have Qt 4.8.5 mingw32 and I installed QCA binary from "here":http://delta.affinix.com/download/qca/.
      @
      Here is output of QCA::supportedFeatures():
      @

      ("random", "md5", "sha1", "keystorelist", "pgpkey", "openpgp", "log", "sasl", "sha0", "ripemd160", "md4", "sha224", "sha256", "sha384", "sha512", "hmac(md5)", "hmac(sha1)", "hmac(sha224)", "hmac(sha256)", "hmac(sha384)", "hmac(sha512)", "hmac(ripemd160)", "aes128-ecb", "aes128-cfb", "aes128-cbc", "aes128-cbc-pkcs7", "aes128-ofb", "aes192-ecb", "aes192-cfb", "aes192-cbc", "aes192-cbc-pkcs7", "aes192-ofb", "aes256-ecb", "aes256-cbc", "aes256-cbc-pkcs7", "aes256-cfb", "aes256-ofb", "blowfish-ecb", "blowfish-cbc-pkcs7", "blowfish-cbc", "blowfish-cfb", "blowfish-ofb", "tripledes-ecb", "tripledes-cbc", "des-ecb", "des-ecb-pkcs7", "des-cbc", "des-cbc-pkcs7", "des-cfb", "des-ofb", "cast5-ecb", "cast5-cbc", "cast5-cbc-pkcs7", "cast5-cfb", "cast5-ofb", "pbkdf1(sha1)", "pbkdf2(sha1)", "pkey", "dlgroup", "rsa", "dsa", "dh", "cert", "csr", "crl", "certcollection", "pkcs12", "tls", "cms", "ca")

      But I can't load pgp keys.

      @
      QFile file("C:\20140715_Client_CF8EB0A_public.asc");
      file.open(QIODevice::ReadOnly | QIODevice::Text);
      QCA::ConvertResult res;
      QCA::PGPKey key = QCA::PGPKey::fromArray(file.readAll(), &res);
      qDebug() << "res " << res << " good " << QCA::ConvertGood;

      if (res == QCA::ConvertGood)
          qDebug() << "Convert good!";
      else
          qDebug() << "Convert bad!";
      

      @

      Here is output:
      res 1 good 0
      Convert bad!
      It's always failed, what's wrong?

      1 Reply Last reply Reply Quote 0
      • Chris Kawa
        Chris Kawa Moderators last edited by

        A shot in the dark, but maybe try to read the file in binary mode (i.e. without QIODevice::Text) ?

        1 Reply Last reply Reply Quote 0
        • D
          Dmitry A last edited by

          Thanks for your reply. The same issue :-(
          Maybe I link with QCA wrong ...
          @
          I just added LIBS += -lqca2
          @
          How should I do this?

          1 Reply Last reply Reply Quote 0
          • Chris Kawa
            Chris Kawa Moderators last edited by

            Some obvious questions first.

            Did you download the right binary (i.e. same compiler) or compiled it yourself?. The page says it depends on Qt 4.2 so maybe you need to build it from source with Qt 4.8.5?

            Do you have all the required dependencies? The page says it depends on external plugins for most of the functionality.

            1 Reply Last reply Reply Quote 0
            • D
              Dmitry A last edited by

              No, I didn't build it myself.
              I have openssl libs.
              What's files I need for gnupgp?

              1 Reply Last reply Reply Quote 0
              • D
                Dmitry A last edited by

                I have installed gnupgp in system, but I don't know how should it work with Qt*

                1 Reply Last reply Reply Quote 0
                • D
                  Dmitry A last edited by

                  I found the reason, I saw qca diagnoting.
                  Here the reason:

                  C:\Program Files\GNU\GnuPG\gpg.exe --no-tty --no-default-keyring --keyring C:/DOCUME~1/Admin/LOCALS~1/Temp/qca_gnupg_tmp.KcC784.gpg --secret-keyring C:/DOCUME~1/Admin/LOCALS~1/Temp/qca_gnupg_tmp.WYv784.gpg --import

                  Can you help?
                  I tried write in command line:

                  C:\binaries\binaries>gpg --no-tty --no-default-keyring --keyring C:/DOCUME~1
                  in/LOCALS~1/Temp/qca_gnupg_tmp.KcC784.gpg --secret-keyring C:/DOCUME~1/Admin
                  ALS~1/Temp/qca_gnupg_tmp.WYv784.gpg --import --verbose
                  gpg: can't create C:/Documents and Settings/Admin/Application Data/gnupg\C: UME~1/Admin/LOCALS~1/Temp/qca_gnupg_tmp.WYv784.gpg.lock': gpg: can't allocate lock for C:/Documents and Settings/Admin/Application Da
                  nupg\C:/DOCUME~1/Admin/LOCALS~1/Temp/qca_gnupg_tmp.WYv784.gpg'
                  gpg: keyblock resource C:/Documents and Settings/Admin/Application Data/gnu :/DOCUME~1/Admin/LOCALS~1/Temp/qca_gnupg_tmp.WYv784.gpg': глобальная ошибка gpg: can't create C:/Documents and Settings/Admin/Application Data/gnupg\C:
                  UME~1/Admin/LOCALS~1/Temp/qca_gnupg_tmp.KcC784.gpg.lock':
                  gpg: can't allocate lock for C:/Documents and Settings/Admin/Application Da nupg\C:/DOCUME~1/Admin/LOCALS~1/Temp/qca_gnupg_tmp.KcC784.gpg' gpg: keyblock resource C:/Documents and Settings/Admin/Application Data/gnu
                  :/DOCUME~1/Admin/LOCALS~1/Temp/qca_gnupg_tmp.KcC784.gpg': global error

                  What I do wrong?

                  1 Reply Last reply Reply Quote 0
                  • D
                    Dmitry A last edited by

                    Thanks for your comment, but it doesn't make a sence. You write trash which leads to no result.
                    Can you say something about subject?

                    GPGProc: Running: [C:\Program Files\GNU\GnuPG\gpg.exe --no-tty --no-default-keyring --keyring C:/DOCUME~1/Admin/LOCALS~1/Temp/qca_gnupg_tmp.KE2200.gpg --secret-keyring C:/DOCUME~1/Admin/LOCALS~1/Temp/qca_gnupg_tmp.cg2200.gpg --import]
                    GPGProc: Process started
                    GPGProc: Process finished: 2
                    GPGProc: Done
                    GPG Process Finished: exitStatus

                    Why it happens?

                    1 Reply Last reply Reply Quote 0
                    • D
                      Dmitry A last edited by

                      I use linux :-)
                      app works well on mac and linux, but windows makes problems, it should be crossplatform app.

                      1 Reply Last reply Reply Quote 0
                      • T
                        taurus last edited by

                        First you need to have gpg.exe in PATH on Windows. Note old QCA from [delta.affinix.com] supports only gpg name and not gpg2. Anyway you can use any gpg version 1 or gpg version 2. gpg version 2 is more suitable for desktop.

                        About you problem try to get diagnostic output with
                        @QCA::KeyStoreManager::diagnosticText@

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post