QSslKey¶
The QSslKey
class provides an interface for private and public keys. More…

Synopsis¶
Detailed Description¶
QSslKey
provides a simple API for managing keys.
See also
-
class
PySide6.QtNetwork.
QSslKey
¶ PySide6.QtNetwork.QSslKey(device, algorithm[, format=QSsl.Pem[, type=QSsl.PrivateKey[, passPhrase=QByteArray()]]])
PySide6.QtNetwork.QSslKey(handle[, type=QSsl.PrivateKey])
PySide6.QtNetwork.QSslKey(encoded, algorithm[, format=QSsl.Pem[, type=QSsl.PrivateKey[, passPhrase=QByteArray()]]])
PySide6.QtNetwork.QSslKey(other)
- Parameters
handle –
Qt::HANDLE
other –
PySide6.QtNetwork.QSslKey
encoded –
PySide6.QtCore.QByteArray
device –
PySide6.QtCore.QIODevice
algorithm –
KeyAlgorithm
passPhrase –
PySide6.QtCore.QByteArray
format –
EncodingFormat
type –
KeyType
Constructs a null key.
See also
Constructs a QSslKey
from a valid native key handle
. type
specifies whether the key is public or private.
QSslKey
will take ownership for this key and you must not free the key using the native library.
-
PySide6.QtNetwork.QSslKey.
algorithm
()¶ - Return type
Returns the key algorithm.
-
PySide6.QtNetwork.QSslKey.
clear
()¶
Clears the contents of this key, making it a null key.
See also
-
PySide6.QtNetwork.QSslKey.
handle
()¶ - Return type
Qt::HANDLE
Returns a pointer to the native key handle, if there is one, else None
.
You can use this handle together with the native API to access extended information about the key.
Warning
Use of this function has a high probability of being non-portable, and its return value may vary across platforms, and between minor Qt releases.
-
PySide6.QtNetwork.QSslKey.
isNull
()¶ - Return type
bool
Returns true
if this is a null key; otherwise false.
See also
-
PySide6.QtNetwork.QSslKey.
length
()¶ - Return type
int
Returns the length of the key in bits, or -1 if the key is null.
-
PySide6.QtNetwork.QSslKey.
__ne__
(key)¶ - Parameters
- Return type
bool
-
PySide6.QtNetwork.QSslKey.
__eq__
(key)¶ - Parameters
- Return type
bool
Returns true
if this key is equal to other
; otherwise returns false
.
-
PySide6.QtNetwork.QSslKey.
swap
(other)¶ - Parameters
other –
PySide6.QtNetwork.QSslKey
-
PySide6.QtNetwork.QSslKey.
toDer
([passPhrase=QByteArray()])¶ - Parameters
passPhrase –
PySide6.QtCore.QByteArray
- Return type
Returns the key in DER encoding.
The passPhrase
argument should be omitted as DER cannot be encrypted. It will be removed in a future version of Qt.
-
PySide6.QtNetwork.QSslKey.
toPem
([passPhrase=QByteArray()])¶ - Parameters
passPhrase –
PySide6.QtCore.QByteArray
- Return type
Returns the key in PEM encoding. The result is encrypted with passPhrase
if the key is a private key and passPhrase
is non-empty.
Returns the type of the key (i.e., PublicKey or PrivateKey).
© 2021 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.