int SslContext::setKeyCertificateFile(const char *pKeyFile, int iKeyType, const char *pCertFile, int iCertType, int chained) { if (!setCertificateFile(pCertFile, iCertType, chained)) return 0; if (!setPrivateKeyFile(pKeyFile, iKeyType)) return 0; return SSL_CTX_check_private_key(m_pCtx); }
SshKeyCreationDialog::SshKeyCreationDialog(QWidget *parent) : QDialog(parent), m_keyGenerator(0), m_ui(new Ui::SshKeyCreationDialog) { m_ui->setupUi(this); const QString defaultPath = QDesktopServices::storageLocation(QDesktopServices::HomeLocation) + QLatin1String("/.ssh/qtc_id"); setPrivateKeyFile(defaultPath); connect(m_ui->rsa, SIGNAL(toggled(bool)), this, SLOT(keyTypeChanged())); connect(m_ui->dsa, SIGNAL(toggled(bool)), this, SLOT(keyTypeChanged())); connect(m_ui->privateKeyFileButton, SIGNAL(clicked()), SLOT(handleBrowseButtonClicked())); connect(m_ui->generateButton, SIGNAL(clicked()), this, SLOT(generateKeys())); }
SshKeyCreationDialog::SshKeyCreationDialog(QWidget *parent) : QDialog(parent), m_keyGenerator(0), m_ui(new Ui::SshKeyCreationDialog) { m_ui->setupUi(this); // Not using Utils::PathChooser::browseButtonLabel to avoid dependency #ifdef Q_OS_MAC m_ui->privateKeyFileButton->setText(tr("Choose...")); #else m_ui->privateKeyFileButton->setText(tr("Browse...")); #endif const QString defaultPath = QDesktopServices::storageLocation(QDesktopServices::HomeLocation) + QLatin1String("/.ssh/qtc_id"); setPrivateKeyFile(defaultPath); connect(m_ui->rsa, SIGNAL(toggled(bool)), this, SLOT(keyTypeChanged())); connect(m_ui->dsa, SIGNAL(toggled(bool)), this, SLOT(keyTypeChanged())); connect(m_ui->privateKeyFileButton, SIGNAL(clicked()), SLOT(handleBrowseButtonClicked())); connect(m_ui->generateButton, SIGNAL(clicked()), this, SLOT(generateKeys())); }
SshKeyCreationDialog::SshKeyCreationDialog(QWidget *parent) : QDialog(parent), m_ui(new Ui::SshKeyCreationDialog) { m_ui->setupUi(this); // Not using Utils::PathChooser::browseButtonLabel to avoid dependency #ifdef Q_OS_MAC m_ui->privateKeyFileButton->setText(tr("Choose...")); #else m_ui->privateKeyFileButton->setText(tr("Browse...")); #endif const QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + QLatin1String("/.ssh/qtc_id"); setPrivateKeyFile(defaultPath); connect(m_ui->rsa, &QRadioButton::toggled, this, &SshKeyCreationDialog::keyTypeChanged); connect(m_ui->privateKeyFileButton, &QPushButton::clicked, this, &SshKeyCreationDialog::handleBrowseButtonClicked); connect(m_ui->generateButton, &QPushButton::clicked, this, &SshKeyCreationDialog::generateKeys); keyTypeChanged(); }
void SshKeyCreationDialog::handleBrowseButtonClicked() { const QString filePath = QFileDialog::getSaveFileName(this, tr("Choose Private Key File Name")); if (!filePath.isEmpty()) setPrivateKeyFile(filePath); }