summaryrefslogtreecommitdiffstats
path: root/src/plugins/tls/shared/qwincrypt_p.h
diff options
context:
space:
mode:
authorTobias Koenig <tobias.koenig@kdab.com>2023-04-25 09:25:44 +0200
committerTobias Koenig <tobias.koenig@kdab.com>2023-05-05 19:58:36 +0200
commit2162e0dfc4b714d24c5610cab1e37e0e0cf4c74e (patch)
tree6e67bdd98a588e66f3d5771371ad22fadba52845 /src/plugins/tls/shared/qwincrypt_p.h
parent392b6e657c088a378693657702eca6162d108d23 (diff)
Schannel: Add support for import of PKCS12/PFX files
Add the missing functionality to the Schannel backend to make QSslCertificate::importPkcs12() work on Windows. [ChangeLog][QtNetwork][QSslCertificate] Add support for PKCS12 import with Schannel backend. Change-Id: Ibb501724d0dc78b0507ac8becf4776fbba0a0623 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/plugins/tls/shared/qwincrypt_p.h')
-rw-r--r--src/plugins/tls/shared/qwincrypt_p.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/tls/shared/qwincrypt_p.h b/src/plugins/tls/shared/qwincrypt_p.h
index 1b1f0f16c0..48ca4247fa 100644
--- a/src/plugins/tls/shared/qwincrypt_p.h
+++ b/src/plugins/tls/shared/qwincrypt_p.h
@@ -40,6 +40,16 @@ struct QHCertStoreDeleter {
// A simple RAII type used by Schannel code and Window CA fetcher class:
using QHCertStorePointer = std::unique_ptr<void, QHCertStoreDeleter>;
+struct QPCCertContextDeleter {
+ void operator()(PCCERT_CONTEXT context) const
+ {
+ CertFreeCertificateContext(context);
+ }
+};
+
+// A simple RAII type used by Schannel code
+using QPCCertContextPointer = std::unique_ptr<const CERT_CONTEXT, QPCCertContextDeleter>;
+
QT_END_NAMESPACE
#endif // QWINCRYPT_P_H