本文整理汇总了C++中QSslCipher::usedBits方法的典型用法代码示例。如果您正苦于以下问题:C++ QSslCipher::usedBits方法的具体用法?C++ QSslCipher::usedBits怎么用?C++ QSslCipher::usedBits使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSslCipher
的用法示例。
在下文中一共展示了QSslCipher::usedBits方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: socketEncrypted
void QgsAuthSslImportDialog::socketEncrypted()
{
QgsDebugMsg( "socketEncrypted entered" );
if ( !mSocket )
return; // might have disconnected already
appendString( tr( "Socket ENCRYPTED" ) );
appendString( QStringLiteral( "%1: %2" ).arg( tr( "Protocol" ),
QgsAuthCertUtils::getSslProtocolName( mSocket->protocol() ) ) );
QSslCipher ciph = mSocket->sessionCipher();
QString cipher = QStringLiteral( "%1: %2, %3 (%4/%5)" )
.arg( tr( "Session cipher" ), ciph.authenticationMethod(), ciph.name() )
.arg( ciph.usedBits() ).arg( ciph.supportedBits() );
appendString( cipher );
wdgtSslConfig->setEnabled( true );
QString hostport( QStringLiteral( "%1:%2" ).arg( mSocket->peerName() ).arg( mSocket->peerPort() ) );
wdgtSslConfig->setSslCertificate( mSocket->peerCertificate(), hostport.trimmed() );
if ( !mSslErrors.isEmpty() )
{
wdgtSslConfig->appendSslIgnoreErrors( mSslErrors );
mSslErrors.clear();
}
// checkCanSave();
// must come after last state change, or gets reverted
leServer->setStyleSheet( QgsAuthGuiUtils::greenTextStyleSheet() );
destroySocket();
}
示例2: socketEncrypted
void SslClient::socketEncrypted()
{
QSslCipher ciph = ssl_->sessionCipher();
QString cipher = QString("%1, %2 (%3/%4)").arg(ciph.authenticationMethod())
.arg(ciph.name()).arg(ciph.usedBits()).arg(ciph.supportedBits());
CDebug() << "SSL cipher " << cipher;
}
示例3: qPrintable
QDebug operator<<(QDebug debug, const QSslCipher &cipher)
{
debug << "QSslCipher(name=" << qPrintable(cipher.name())
<< ", bits=" << cipher.usedBits()
<< ", proto=" << qPrintable(cipher.protocolString())
<< ")";
return debug;
}
示例4: saver
QDebug operator<<(QDebug debug, const QSslCipher &cipher)
{
QDebugStateSaver saver(debug);
debug.resetFormat().nospace().noquote();
debug << "QSslCipher(name=" << cipher.name()
<< ", bits=" << cipher.usedBits()
<< ", proto=" << cipher.protocolString()
<< ')';
return debug;
}
示例5: dumpCipher
QString dumpCipher(const QSslCipher &cipher)
{
QString s = "\n";
s += "Authentication: " + cipher.authenticationMethod() + "\n";
s += "Encryption: " + cipher.encryptionMethod() + "\n";
s += "Key Exchange: " + cipher.keyExchangeMethod() + "\n";
s += "Cipher Name: " + cipher.name() + "\n";
s += "Protocol: " + cipher.protocolString() + "\n";
s += "Supported Bits: " + QString(cipher.supportedBits()) + "\n";
s += "Used Bits: " + QString(cipher.usedBits()) + "\n";
return s;
}
示例6: socketEncrypted
void SslClient::socketEncrypted()
{
form->sessionOutput->clear();
form->sessionInput->setFocus();
QPalette palette;
palette.setColor(QPalette::Base, QColor(255, 255, 192));
form->hostNameEdit->setPalette(palette);
const QSslCipher cipher = socket->sessionCipher();
const QString cipherInfo = QString("%1, %2 (%3/%4)").arg(cipher.authenticationMethod())
.arg(cipher.name()).arg(cipher.usedBits())
.arg(cipher.supportedBits());;
form->cipherLabel->setText(cipherInfo);
padLock->show();
}
示例7: socketEncrypted
void SslClient::socketEncrypted()
{
if (!socket)
return; // might have disconnected already
form->sessionOutput->clear();
form->sessionInput->setFocus();
QPalette palette;
palette.setColor(QPalette::Base, QColor(255, 255, 192));
form->hostNameEdit->setPalette(palette);
QSslCipher ciph = socket->sessionCipher();
QString cipher = QString("%1, %2 (%3/%4)").arg(ciph.authenticationMethod())
.arg(ciph.name()).arg(ciph.usedBits()).arg(ciph.supportedBits());;
form->cipherLabel->setText(cipher);
if (!padLock) {
padLock = new QToolButton;
padLock->setIcon(QIcon(":/encrypted.png"));
#ifndef QT_NO_CURSOR
padLock->setCursor(Qt::ArrowCursor);
#endif
padLock->setToolTip(tr("Display encryption details."));
int extent = form->hostNameEdit->height() - 2;
padLock->resize(extent, extent);
padLock->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
QHBoxLayout *layout = new QHBoxLayout(form->hostNameEdit);
layout->setMargin(form->hostNameEdit->style()->pixelMetric(QStyle::PM_DefaultFrameWidth));
layout->setSpacing(0);
layout->addStretch();
layout->addWidget(padLock);
form->hostNameEdit->setLayout(layout);
connect(padLock, SIGNAL(clicked()),
this, SLOT(displayCertificateInfo()));
} else {
padLock->show();
}
}
示例8: socketEncrypted
//! [3]
void SslClient::socketEncrypted()
{
if (!m_socket)
return; // Might have disconnected already
// We started a new connection, so clear the response from previous connections
m_response.clear();
emit responseChanged();
// Retrieve the information about the used cipher and update the property
const QSslCipher cipher = m_socket->sessionCipher();
m_cipher = QString("%1, %2 (%3/%4)").arg(cipher.authenticationMethod())
.arg(cipher.name())
.arg(cipher.usedBits())
.arg(cipher.supportedBits());
emit cipherChanged();
// Tell the CertificateInfoControl about the certificate chain of this connection
emit certificateChainChanged(m_socket->peerCertificateChain());
}
示例9: updateAccountInfo
void SslButton::updateAccountInfo(Account *account)
{
if (!account || account->state() != Account::Connected) {
setVisible(false);
return;
} else {
setVisible(true);
}
if (account->url().scheme() == QLatin1String("https")) {
setIcon(QIcon(QPixmap(":/mirall/resources/lock-https.png")));
QSslCipher cipher = account->sslConfiguration().sessionCipher();
setToolTip(tr("This connection is encrypted using %1 bit %2.\n").arg(cipher.usedBits()).arg(cipher.name()));
QMenu *menu = new QMenu(this);
QList<QSslCertificate> chain = account->sslConfiguration().peerCertificateChain();
menu->addAction(tr("Certificate information:"))->setEnabled(false);
QList<QSslCertificate> tmpChain;
foreach(QSslCertificate cert, chain) {
tmpChain << cert;
if (QSslSocket::systemCaCertificates().contains(cert))
break;
}
示例10: connectionAccepted
void Server::connectionAccepted()
{
qDebug() << "SERVER: Now connected";
qDebug() << "SERVER: Connection is encrypted:" << clientConnection -> isEncrypted();
qDebug() << "SERVER: Socket Descriptor:" << clientConnection -> socketDescriptor();
QSslCipher ciph = clientConnection->sessionCipher();
QString cipher = QString("%1, %2 (%3/%4)").arg(ciph.authenticationMethod()).arg(ciph.name()).arg(ciph.usedBits()).arg(ciph.supportedBits());
qDebug() << "SERVER: Cipher:" << cipher;
connected=1;
emit readyToSendData();
}
示例11: cipher
QString Server :: getSSLCypher()
{
QString cipher("");
if(connected) //I know it's not pretty but it looks a lot better than a segfault :P
if(clientConnection!=0)
if(clientConnection -> isOpen())
{
QSslCipher ciph = clientConnection->sessionCipher();
cipher = QString("%1, %2 (%3/%4)").arg(ciph.authenticationMethod()).arg(ciph.name()).arg(ciph.usedBits()).arg(ciph.supportedBits());
}
return cipher;
}