Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-31815

Validate that a private key and the public key of a certificate match

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • Network: SSL
    • None

    Description

      Today the code does the validation too late, when connecting (client side) or when receiving a connection (server side). Especially on the server side, you want to know upfront that your configuration is wrong, instead of waiting for the first client attempting to connect

      I think the cleanest way would be to provide an accessor to the public key from the private key:

      /* If the key is a private key, return the associated public key */
      QSslCertificate QSslKey::privateKey() const

      /* Existing API: return the public key of the certificate */
      QSslKey QSslCertificate::publicKey() const

      Sample interation would be through the == operator:

      QSslKey private(…)
      QSslCertificate cert(…)
      if (private.publicKey() != cert.publicKey()) {
      // wrong key pair…
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            richmoore Richard Moore (qtnetwork)
            marco.m Marco Molteni
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes