68 self.issuerOrganizationLabel.setText(self.__certificateString( |
68 self.issuerOrganizationLabel.setText(self.__certificateString( |
69 certificate.issuerInfo(QSslCertificate.Organization))) |
69 certificate.issuerInfo(QSslCertificate.Organization))) |
70 self.issuerOrganizationalUnitLabel.setText(self.__certificateString( |
70 self.issuerOrganizationalUnitLabel.setText(self.__certificateString( |
71 certificate.issuerInfo(QSslCertificate.OrganizationalUnitName))) |
71 certificate.issuerInfo(QSslCertificate.OrganizationalUnitName))) |
72 self.serialNumberLabel.setText(self.__serialNumber(certificate)) |
72 self.serialNumberLabel.setText(self.__serialNumber(certificate)) |
73 self.effectiveLabel.setText(Utilities.html_encode( |
73 self.effectiveLabel.setText( |
74 certificate.effectiveDate().toString("yyyy-MM-dd"))) |
74 certificate.effectiveDate().toString("yyyy-MM-dd")) |
75 self.expiresLabel.setText(Utilities.html_encode( |
75 self.expiresLabel.setText( |
76 certificate.expiryDate().toString("yyyy-MM-dd"))) |
76 certificate.expiryDate().toString("yyyy-MM-dd")) |
77 self.sha1Label.setText(self.__formatHexString( |
77 self.sha1Label.setText(self.__formatHexString( |
78 str(certificate.digest(QCryptographicHash.Sha1).toHex(), encoding="ascii"))) |
78 str(certificate.digest(QCryptographicHash.Sha1).toHex(), encoding="ascii"))) |
79 self.md5Label.setText(self.__formatHexString( |
79 self.md5Label.setText(self.__formatHexString( |
80 str(certificate.digest(QCryptographicHash.Md5).toHex(), encoding="ascii"))) |
80 str(certificate.digest(QCryptographicHash.Md5).toHex(), encoding="ascii"))) |
81 |
81 |
95 @return prepared text (string) |
95 @return prepared text (string) |
96 """ |
96 """ |
97 if txt is None or txt == "": |
97 if txt is None or txt == "": |
98 return self.trUtf8("<not part of the certificate>") |
98 return self.trUtf8("<not part of the certificate>") |
99 |
99 |
100 return Utilities.html_encode(Utilities.decodeString(txt)) |
100 return Utilities.decodeString(txt) |
101 |
101 |
102 def __serialNumber(self, cert): |
102 def __serialNumber(self, cert): |
103 """ |
103 """ |
104 Private slot to format the certificate serial number. |
104 Private slot to format the certificate serial number. |
105 |
105 |
131 hexList = [] |
131 hexList = [] |
132 while hexString: |
132 while hexString: |
133 hexList.append(hexString[:2]) |
133 hexList.append(hexString[:2]) |
134 hexString = hexString[2:] |
134 hexString = hexString[2:] |
135 |
135 |
136 return Utilities.html_encode(':'.join(hexList)) |
136 return ':'.join(hexList) |
137 |
137 |
138 def __hasExpired(self, effectiveDate, expiryDate): |
138 def __hasExpired(self, effectiveDate, expiryDate): |
139 """ |
139 """ |
140 Private method to check for a certificate expiration. |
140 Private method to check for a certificate expiration. |
141 |
141 |