19 from .Ui_E5SslCertificateSelectionDialog import \ |
19 from .Ui_E5SslCertificateSelectionDialog import \ |
20 Ui_E5SslCertificateSelectionDialog |
20 Ui_E5SslCertificateSelectionDialog |
21 |
21 |
22 import Utilities |
22 import Utilities |
23 import UI.PixmapCache |
23 import UI.PixmapCache |
24 from Globals import qVersionTuple |
|
25 |
24 |
26 |
25 |
27 class E5SslCertificateSelectionDialog(QDialog, |
26 class E5SslCertificateSelectionDialog(QDialog, |
28 Ui_E5SslCertificateSelectionDialog): |
27 Ui_E5SslCertificateSelectionDialog): |
29 """ |
28 """ |
72 |
71 |
73 @param cert certificate to insert |
72 @param cert certificate to insert |
74 @type QSslCertificate |
73 @type QSslCertificate |
75 """ |
74 """ |
76 # step 1: extract the info to be shown |
75 # step 1: extract the info to be shown |
77 if qVersionTuple() >= (5, 0, 0): |
76 organisation = Utilities.decodeString( |
78 organisation = Utilities.decodeString( |
77 ", ".join(cert.subjectInfo(QSslCertificate.Organization))) |
79 ", ".join(cert.subjectInfo(QSslCertificate.Organization))) |
78 commonName = Utilities.decodeString( |
80 commonName = Utilities.decodeString( |
79 ", ".join(cert.subjectInfo(QSslCertificate.CommonName))) |
81 ", ".join(cert.subjectInfo(QSslCertificate.CommonName))) |
|
82 else: |
|
83 organisation = Utilities.decodeString( |
|
84 cert.subjectInfo(QSslCertificate.Organization)) |
|
85 commonName = Utilities.decodeString( |
|
86 cert.subjectInfo(QSslCertificate.CommonName)) |
|
87 if organisation is None or organisation == "": |
80 if organisation is None or organisation == "": |
88 organisation = self.tr("(Unknown)") |
81 organisation = self.tr("(Unknown)") |
89 if commonName is None or commonName == "": |
82 if commonName is None or commonName == "": |
90 commonName = self.tr("(Unknown common name)") |
83 commonName = self.tr("(Unknown common name)") |
91 expiryDate = cert.expiryDate().toString("yyyy-MM-dd") |
84 expiryDate = cert.expiryDate().toString("yyyy-MM-dd") |