Results 1 to 3 of 3

Thread: QCA (on Windows): trouble using qca-ossl when creating a public key

  1. #1
    Join Date
    Mar 2011
    Posts
    5
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCA (on Windows): trouble using qca-ossl when creating a public key

    I’m having a hard time determining where to submit bugs or find help using the QCA. I’m building on Windows using Mingw and I get a segfault at the line:
    Qt Code:
    1. k->createPublic(n, e);
    To copy to clipboard, switch view to plain text mode 
    in the method:
    Qt Code:
    1. RSAPublicKey::RSAPublicKey(const BigInteger &n, const BigInteger &e, const QString &provider)
    To copy to clipboard, switch view to plain text mode 
    All my unit tests pass but I don’t see a particular unit test for creating a public key directly from the modulus and exponent (one of the few examples I found online):
    Qt Code:
    1. QString eee("22640209");//exp: got from server
    2. QString mmm("95033496681677513042303794296510796923484007896833482880191206334940729008671");
    3. QCA::BigInteger exp11(eee);
    4. QCA::BigInteger mod11(mmm);
    5. QCA::PublicKey *public_key;
    6. public_key = new QCA::RSAPublicKey(mod11,exp11,"qca-ossl");
    To copy to clipboard, switch view to plain text mode 
    What might I be doing wrong when building in windows? Is the provider not loading? If I run "qcatool2 plugins" I get

    C:\workspace\qtcreator-build>qcatool2 plugins
    Qt Library Paths:
    C:/QtSDK/Desktop/Qt/4.7.2/mingw/plugins
    C:/QtSDK/Desktop/Qt/4.7.2/mingw/bin
    Available Providers:
    qca-logger
    qca-ossl
    This product includes cryptographic software written by Eric Young
    (eay@cryptsoft.com)
    qca-softstore


    Added after 4 minutes:


    It's also worth mentioning that I have the code wrapped like so:
    Qt Code:
    1. if (!QCA::isSupported("pkey", "qca-ossl") ||
    2. !QCA::PKey::supportedTypes("qca-ossl").contains(QCA::PKey::RSA) ||
    3. !QCA::PKey::supportedIOTypes("qca-ossl").contains(QCA::PKey::RSA)) {
    4. qDebug() << "RSA not supported!";
    5. } else {
    6. QString eee("22640209");//exp: got from server
    7. QString mmm("95033496681677513042303794296510796923484007896833482880191206334940729008671");
    8. QCA::BigInteger exp11(eee);
    9. QCA::BigInteger mod11(mmm);
    10. QCA::PublicKey *public_key;
    11. public_key = new QCA::RSAPublicKey(mod11,exp11,"qca-ossl");
    12. }
    To copy to clipboard, switch view to plain text mode 

    And I do initialize the QCA in main.cpp.
    Last edited by pocketchange; 9th March 2011 at 23:26.

  2. The following 2 users say thank you to pocketchange for this useful post:


  3. #2
    Join Date
    Mar 2011
    Posts
    5
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCA (on Windows): trouble using qca-ossl when creating a public key

    Ok, I (soft of) solved this. The probably only exists in the qcad2.dll, so if I like to the non-debug version, it seems to work just fine. I just modified my crypto.prf file and modified the line

    Qt Code:
    1. windows:LINKAGE = -lqcad
    To copy to clipboard, switch view to plain text mode 

    to
    Qt Code:
    1. windows:LINKAGE = -lqca
    To copy to clipboard, switch view to plain text mode 

    That let me continue with my application (although I'm unable to debug QCA, but I haven't had to yet).

  4. The following 2 users say thank you to pocketchange for this useful post:


  5. #3
    Join Date
    Nov 2011
    Posts
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Symbian S60

    Default Re: QCA (on Windows): trouble using qca-ossl when creating a public key

    You can try the tutorial in http://www.essentialunix.org/index.p...ials&Itemid=53

    And then you build the source of QCA in "Desktop release" and "Desktop Debug". It will generate the lib in rel and deb folder and possible to use it. I can do encry and decry on Desktop now. (Windows 7 + qca + qca-ossl with aes 256)

    Btw, i can't make use of it on Symbian Platform. Seem i'm using "OpenSSL for desktop". Do you have any idea?

    Thanks.

  6. The following 2 users say thank you to MagicR for this useful post:


Similar Threads

  1. Trouble compile QIBASE plugin on Windows
    By estanisgeyer in forum Newbie
    Replies: 2
    Last Post: 25th May 2011, 12:55
  2. Replies: 1
    Last Post: 10th March 2011, 00:24
  3. MinGW and qca-ossl
    By December in forum Qt Programming
    Replies: 5
    Last Post: 9th March 2011, 23:42
  4. Trouble with creating custom class
    By jstippey in forum Qt Programming
    Replies: 9
    Last Post: 12th January 2011, 15:08
  5. Trouble deploying on Windows
    By kiss-o-matic in forum Installation and Deployment
    Replies: 6
    Last Post: 17th October 2010, 07:42

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.