QSslKey Class
La classe QSslKey fornisce un'interfaccia per le chiavi private e pubbliche. Per saperne di più...
| Intestazione: | #include <QSslKey> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Network) target_link_libraries(mytarget PRIVATE Qt6::Network) |
| qmake: | QT += network |
- Elenco di tutti i membri, compresi quelli ereditati
- QSslKey fa parte dell'API di programmazione di rete e delle classi condivise implicitamente.
Nota: tutte le funzioni di questa classe sono rientranti.
Funzioni pubbliche
| 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 |
Vedi anche QSslSocket, QSslCertificate e QSslCipher.
Documentazione delle funzioni membro
QSslKey::QSslKey()
Crea una chiave nulla.
Vedi anche isNull().
[explicit] QSslKey::QSslKey(Qt::HANDLE handle, QSsl::KeyType type = QSsl::PrivateKey)
Crea un oggetto QSslKey a partire da una chiave nativa valida handle. Il parametro type specifica se la chiave è pubblica o privata.
QSslKey assumerà la proprietà di questa chiave e non è consentito liberarla utilizzando la libreria nativa.
QSslKey::QSslKey(QIODevice *device, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat encoding = QSsl::Pem, QSsl::KeyType type = QSsl::PrivateKey, const QByteArray &passPhrase = QByteArray())
Crea un oggetto QSslKey leggendo e decodificando i dati da un file device utilizzando un formato algorithm e encoding specificato. Il parametro type specifica se la chiave è pubblica o privata.
Se la chiave è crittografata, viene utilizzato passPhrase per decrittografarla.
Dopo la creazione, utilizzare isNull() per verificare se device ha fornito una chiave valida.
QSslKey::QSslKey(const QByteArray &encoded, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat encoding = QSsl::Pem, QSsl::KeyType type = QSsl::PrivateKey, const QByteArray &passPhrase = QByteArray())
Crea un oggetto QSslKey decodificando la stringa contenuta nell'array di byte encoded utilizzando un formato specificato algorithm e encoding. type specifica se la chiave è pubblica o privata.
Se la chiave è crittografata, passPhrase viene utilizzato per decrittografarla.
Dopo la creazione, utilizzare isNull() per verificare se encoded conteneva una chiave valida.
QSslKey::QSslKey(const QSslKey &other)
Crea una copia identica di other.
[noexcept] QSslKey::~QSslKey()
Elimina l'oggetto ` QSslKey `.
QSsl::KeyAlgorithm QSslKey::algorithm() const
Restituisce l'algoritmo della chiave.
void QSslKey::clear()
Cancella il contenuto di questa chiave, rendendola una chiave nulla.
Vedi anche isNull().
Qt::HANDLE QSslKey::handle() const
Restituisce un puntatore all’handle nativo della chiave, se presente, altrimenti un nullptr.
È possibile utilizzare questo handle insieme all'API nativa per accedere a informazioni aggiuntive sulla chiave.
Attenzione: l'uso di questa funzione presenta un'elevata probabilità di non essere portabile e il suo valore di ritorno può variare da una piattaforma all'altra e tra le versioni minori di Qt.
bool QSslKey::isNull() const
Restituisce ` true ` se la chiave è nulla; altrimenti restituisce `false`.
Vedi anche clear().
int QSslKey::length() const
Restituisce la lunghezza della chiave in bit oppure -1 se la chiave è nulla.
[noexcept] void QSslKey::swap(QSslKey &other)
Sostituisce questa chiave SSL con other. Questa operazione è molto veloce e non fallisce mai.
QByteArray QSslKey::toDer(const QByteArray &passPhrase = QByteArray()) const
Restituisce la chiave in codifica DER.
L'argomento ` passPhrase ` deve essere omesso poiché il formato DER non può essere crittografato. Verrà rimosso in una versione futura di Qt.
QByteArray QSslKey::toPem(const QByteArray &passPhrase = QByteArray()) const
Restituisce la chiave in codifica PEM. Il risultato viene crittografato con passPhrase se la chiave è una chiave privata e passPhrase non è vuoto.
QSsl::KeyType QSslKey::type() const
Restituisce il tipo della chiave (ovvero PublicKey o PrivateKey).
bool QSslKey::operator!=(const QSslKey &other) const
Restituisce ` true ` se questa chiave non è uguale a `key other`; altrimenti restituisce ` false`.
QSslKey &QSslKey::operator=(const QSslKey &other)
Copia il contenuto di other in questa chiave, rendendo le due chiavi identiche.
Restituisce un riferimento a questa chiave QSslKey.
bool QSslKey::operator==(const QSslKey &other) const
Restituisce ` true ` se questa chiave è uguale a ` other`; altrimenti restituisce ` false`.
© 2026 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.