本文整理汇总了C++中QSslKey::algorithm方法的典型用法代码示例。如果您正苦于以下问题:C++ QSslKey::algorithm方法的具体用法?C++ QSslKey::algorithm怎么用?C++ QSslKey::algorithm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSslKey
的用法示例。
在下文中一共展示了QSslKey::algorithm方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saver
QDebug operator<<(QDebug debug, const QSslKey &key)
{
QDebugStateSaver saver(debug);
debug.resetFormat().nospace();
debug << "QSslKey("
<< (key.type() == QSsl::PublicKey ? "PublicKey" : "PrivateKey")
<< ", " << (key.algorithm() == QSsl::Opaque ? "OPAQUE" :
(key.algorithm() == QSsl::Rsa ? "RSA" : ((key.algorithm() == QSsl::Dsa) ? "DSA" : "EC")))
<< ", " << key.length()
<< ')';
return debug;
}
示例2: algorithm
QSsl::KeyAlgorithm QSslKeyProto::algorithm() const
{
QSslKey *item = qscriptvalue_cast<QSslKey*>(thisObject());
if (item)
return item->algorithm();
return QSsl::KeyAlgorithm();
}
示例3: keyLenght
int CertificateDialogPrivate::keyLenght( const QSslKey &key ) const
{
switch( key.algorithm() )
{
case QSsl::Dsa: return DSA_size( (DSA*)key.handle() ) * 8;
case QSsl::Rsa: return RSA_size( (RSA*)key.handle() ) * 8;
}
return key.length();
}
示例4: showKeyState
void IdentityEditWidget::showKeyState(const QSslKey &key)
{
if (key.isNull()) {
ui.keyTypeLabel->setText(tr("No Key loaded"));
ui.clearOrLoadKeyButton->setText(tr("Load"));
}
else {
switch (key.algorithm()) {
case QSsl::Rsa:
ui.keyTypeLabel->setText(tr("RSA"));
break;
case QSsl::Dsa:
ui.keyTypeLabel->setText(tr("DSA"));
break;
default:
ui.keyTypeLabel->setText(tr("No Key loaded"));
}
ui.clearOrLoadKeyButton->setText(tr("Clear"));
}
ui.keyTypeLabel->setProperty("sslKey", key.toPem());
ui.keyTypeLabel->setProperty("sslKeyType", (int)key.algorithm());
}