/usr/include/qgis/qgsauthcertificateinfo.h is in libqgis-dev 2.18.17+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | /***************************************************************************
qgsauthcertificateinfo.h
---------------------
begin : April 29, 2015
copyright : (C) 2015 by Boundless Spatial, Inc. USA
author : Larry Shaffer
email : lshaffer at boundlessgeo dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSAUTHCERTIFICATEINFO_H
#define QGSAUTHCERTIFICATEINFO_H
#include <QFile>
#ifndef QT_NO_OPENSSL
#include <QtCrypto>
#include <QSslCertificate>
#endif
#include <QDialog>
#include <QWidget>
#include "ui_qgsauthcertificateinfo.h"
#include "qgsauthcertutils.h"
/** \ingroup gui
* Widget for viewing detailed info on a certificate and its hierarchical trust chain
*/
class GUI_EXPORT QgsAuthCertInfo : public QWidget, private Ui::QgsAuthCertInfo
{
Q_OBJECT
public:
explicit QgsAuthCertInfo( const QSslCertificate& cert,
bool manageCertTrust = false,
QWidget *parent = nullptr,
const QList<QSslCertificate>& connectionCAs = QList<QSslCertificate>() );
~QgsAuthCertInfo();
bool trustCacheRebuilt() { return mTrustCacheRebuilt; }
private slots:
void setupError( const QString& msg );
void currentCertItemChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous );
void updateCurrentCert( QTreeWidgetItem *item );
void on_btnSaveTrust_clicked();
void currentPolicyIndexChanged( int indx );
void decorateCertTreeItem( const QSslCertificate& cert,
QgsAuthCertUtils::CertTrustPolicy trustpolicy,
QTreeWidgetItem * item = nullptr );
private:
enum DetailsType
{
DetailsSection = 1000,
DetailsGroup = 1001,
DetailsField = 1002,
};
enum FieldWidget
{
NoWidget = 0,
LineEdit = 1,
TextEdit = 2,
};
void setUpCertDetailsTree();
void populateTrustBox();
bool populateQcaCertCollection();
bool setQcaCertificate( const QSslCertificate& cert );
bool populateCertChain();
void setCertHierarchy();
void updateCurrentCertInfo( int chainindx );
void populateCertInfo();
QTreeWidgetItem *addGroupItem( QTreeWidgetItem *parent, const QString& group );
void addFieldItem( QTreeWidgetItem *parent, const QString& field, const QString& value, FieldWidget wdgt = NoWidget ,
const QColor& color = QColor() );
void populateInfoGeneralSection();
void populateInfoDetailsSection();
void populateInfoPemTextSection();
QCA::Certificate mCert;
QList<QSslCertificate> mConnectionCAs;
QMap<QString, QPair<QgsAuthCertUtils::CaCertSource, QSslCertificate> > mCaCertsCache;
QCA::CertificateCollection mCaCerts;
QCA::CertificateChain mACertChain;
QList<QSslCertificate> mQCertChain;
QSslCertificate mCurrentQCert;
QCA::Certificate mCurrentACert;
QBrush mDefaultItemForeground;
bool mManageTrust;
bool mTrustCacheRebuilt;
QgsAuthCertUtils::CertTrustPolicy mDefaultTrustPolicy;
QgsAuthCertUtils::CertTrustPolicy mCurrentTrustPolicy;
QTreeWidgetItem *mSecGeneral;
QTreeWidgetItem *mSecDetails;
QTreeWidgetItem *mSecPemText;
QTreeWidgetItem *mGrpSubj;
QTreeWidgetItem *mGrpIssu;
QTreeWidgetItem *mGrpCert;
QTreeWidgetItem *mGrpPkey;
QTreeWidgetItem *mGrpExts;
QVBoxLayout *mAuthNotifyLayout;
QLabel *mAuthNotify;
};
//////////////// Embed in dialog ///////////////////
/** \ingroup gui
* Dialog wrapper for widget displaying detailed info on a certificate and its hierarchical trust chain
*/
class GUI_EXPORT QgsAuthCertInfoDialog : public QDialog
{
Q_OBJECT
public:
/**
* Construct a dialog displaying detailed info on a certificate and its hierarchical trust chain
* @param cert Certificate object
* @param manageCertTrust Whether to show widgets to manage the trust policy of certs in hierarchy
* @param parent Parent widget
* @param connectionCAs List of hierarchical certificates in a connection
*/
explicit QgsAuthCertInfoDialog( const QSslCertificate& cert,
bool manageCertTrust,
QWidget *parent = nullptr,
const QList<QSslCertificate>& connectionCAs = QList<QSslCertificate>() );
~QgsAuthCertInfoDialog();
/** Get access to embedded info widget */
QgsAuthCertInfo *certInfoWidget() { return mCertInfoWdgt; }
/** Whether the trust cache has been rebuilt
* @note This happens when a trust policy has been adjusted for any cert in the hierarchy
*/
bool trustCacheRebuilt() { return mCertInfoWdgt->trustCacheRebuilt(); }
private:
QgsAuthCertInfo *mCertInfoWdgt;
};
#endif // QGSAUTHCERTIFICATEINFO_H
|