QSslKey Class
Die Klasse QSslKey bietet eine Schnittstelle für private und öffentliche Schlüssel. Mehr...
Kopfzeile: | #include <QSslKey> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Network) target_link_libraries(mytarget PRIVATE Qt6::Network) |
qmake: | QT += network |
- Liste aller Mitglieder, einschließlich geerbter Mitglieder
- QSslKey ist Teil von Network Programming API und Implicitly Shared Classes.
Hinweis: Alle Funktionen in dieser Klasse sind reentrant.
Öffentliche Funktionen
QSslKey() | |
QSslKey(Qt::HANDLE handle, QSsl::KeyType type = QSsl::PrivateKey) | |
QSslKey(QIODevice *device, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat encoding = QSsl::Pem, QSsl::KeyType type = QSsl::PrivateKey, const QByteArray &passPhrase = QByteArray()) | |
QSslKey(const QByteArray &encoded, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat encoding = QSsl::Pem, QSsl::KeyType type = QSsl::PrivateKey, const QByteArray &passPhrase = QByteArray()) | |
QSslKey(const QSslKey &other) | |
~QSslKey() | |
QSsl::KeyAlgorithm | algorithm() const |
void | clear() |
Qt::HANDLE | handle() const |
bool | isNull() const |
int | length() const |
void | swap(QSslKey &other) |
QByteArray | toDer(const QByteArray &passPhrase = QByteArray()) const |
QByteArray | toPem(const QByteArray &passPhrase = QByteArray()) const |
QSsl::KeyType | type() const |
bool | operator!=(const QSslKey &other) const |
QSslKey & | operator=(const QSslKey &other) |
bool | operator==(const QSslKey &other) const |
Siehe auch QSslSocket, QSslCertificate, und QSslCipher.
Dokumentation der Mitgliedsfunktionen
QSslKey::QSslKey()
Konstruiert einen Null-Schlüssel.
Siehe auch isNull().
[explicit]
QSslKey::QSslKey(Qt::HANDLE handle, QSsl::KeyType type = QSsl::PrivateKey)
Konstruiert einen QSslKey aus einem gültigen nativen Schlüssel handle. type gibt an, ob der Schlüssel öffentlich oder privat ist.
QSslKey übernimmt die Eigentümerschaft für diesen Schlüssel und Sie dürfen den Schlüssel nicht mit der nativen Bibliothek freigeben.
QSslKey::QSslKey(QIODevice *device, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat encoding = QSsl::Pem, QSsl::KeyType type = QSsl::PrivateKey, const QByteArray &passPhrase = QByteArray())
Konstruiert einen QSslKey durch Lesen und Dekodieren von Daten aus einem device unter Verwendung eines angegebenen algorithm und encoding Formats. type gibt an, ob der Schlüssel öffentlich oder privat ist.
Wenn der Schlüssel verschlüsselt ist, wird passPhrase verwendet, um ihn zu entschlüsseln.
Nach der Konstruktion wird mit isNull() geprüft, ob device einen gültigen Schlüssel liefert.
QSslKey::QSslKey(const QByteArray &encoded, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat encoding = QSsl::Pem, QSsl::KeyType type = QSsl::PrivateKey, const QByteArray &passPhrase = QByteArray())
Konstruiert einen QSslKey durch Dekodierung der Zeichenkette im Byte-Array encoded unter Verwendung eines angegebenen algorithm und encoding Formats. type gibt an, ob der Schlüssel öffentlich oder privat ist.
Wenn der Schlüssel verschlüsselt ist, wird passPhrase verwendet, um ihn zu entschlüsseln.
Nach der Konstruktion wird mit isNull() geprüft, ob encoded einen gültigen Schlüssel enthält.
QSslKey::QSslKey(const QSslKey &other)
Konstruiert eine identische Kopie von other.
[noexcept]
QSslKey::~QSslKey()
Zerstört das Objekt QSslKey.
QSsl::KeyAlgorithm QSslKey::algorithm() const
Gibt den Schlüsselalgorithmus zurück.
void QSslKey::clear()
Löscht den Inhalt dieses Schlüssels und macht ihn zu einem Nullschlüssel.
Siehe auch isNull().
Qt::HANDLE QSslKey::handle() const
Gibt einen Zeiger auf das native Schlüsselhandle zurück, falls eines vorhanden ist, andernfalls nullptr
.
Sie können dieses Handle zusammen mit der nativen API verwenden, um auf erweiterte Informationen über den Schlüssel zuzugreifen.
Warnung: Die Verwendung dieser Funktion ist mit hoher Wahrscheinlichkeit nicht portierbar, und ihr Rückgabewert kann auf verschiedenen Plattformen und zwischen verschiedenen Qt-Versionen variieren.
bool QSslKey::isNull() const
Gibt true
zurück, wenn dies ein Null-Schlüssel ist; andernfalls false.
Siehe auch clear().
int QSslKey::length() const
Gibt die Länge des Schlüssels in Bits zurück, oder -1, wenn der Schlüssel null ist.
[noexcept]
void QSslKey::swap(QSslKey &other)
Tauscht diesen ssl-Schlüssel mit other aus. Dieser Vorgang ist sehr schnell und schlägt nie fehl.
QByteArray QSslKey::toDer(const QByteArray &passPhrase = QByteArray()) const
Gibt den Schlüssel in DER-Kodierung zurück.
Das Argument passPhrase sollte weggelassen werden, da DER nicht verschlüsselt werden kann. Es wird in einer zukünftigen Version von Qt entfernt werden.
QByteArray QSslKey::toPem(const QByteArray &passPhrase = QByteArray()) const
Gibt den Schlüssel in PEM-Kodierung zurück. Das Ergebnis wird mit passPhrase verschlüsselt, wenn der Schlüssel ein privater Schlüssel ist und passPhrase nicht leer ist.
QSsl::KeyType QSslKey::type() const
Gibt den Typ des Schlüssels zurück (d. h. PublicKey oder PrivateKey).
bool QSslKey::operator!=(const QSslKey &other) const
Gibt true
zurück, wenn dieser Schlüssel nicht gleich dem Schlüssel other ist; andernfalls wird false
zurückgegeben.
QSslKey &QSslKey::operator=(const QSslKey &other)
Kopiert den Inhalt von other in diesen Schlüssel, wodurch die beiden Schlüssel identisch werden.
Gibt einen Verweis auf diesen QSslKey zurück.
bool QSslKey::operator==(const QSslKey &other) const
Gibt true
zurück, wenn dieser Schlüssel gleich other ist; andernfalls wird false
zurückgegeben.
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.