内容表

上一话题

QSslError

下一话题

QSslPreSharedKeyAuthenticator

QSslKey

QSslKey class provides an interface for private and public keys. 更多

Inheritance diagram of PySide2.QtNetwork.QSslKey

概要

函数

详细描述

QSslKey provides a simple API for managing keys.

class QSslKey

QSslKey(device, algorithm[, format=QSsl.Pem[, type=QSsl.PrivateKey[, passPhrase=QByteArray()]]])

QSslKey(handle[, type=QSsl.PrivateKey])

QSslKey(encoded, algorithm[, format=QSsl.Pem[, type=QSsl.PrivateKey[, passPhrase=QByteArray()]]])

QSslKey(other)

param type

KeyType

param format

EncodingFormat

param passPhrase

QByteArray

param device

QIODevice

param algorithm

KeyAlgorithm

param other

QSslKey

param handle

Qt::HANDLE

param encoded

QByteArray

Constructs a null key.

另请参阅

isNull()

构造 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.

PySide2.QtNetwork.QSslKey. algorithm ( )
返回类型

KeyAlgorithm

Returns the key algorithm.

PySide2.QtNetwork.QSslKey. clear ( )

Clears the contents of this key, making it a null key.

另请参阅

isNull()

PySide2.QtNetwork.QSslKey. handle ( )
返回类型

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.

警告

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.

PySide2.QtNetwork.QSslKey. isNull ( )
返回类型

bool

返回 true if this is a null key; otherwise false.

另请参阅

clear()

PySide2.QtNetwork.QSslKey. length ( )
返回类型

int

Returns the length of the key in bits, or -1 if the key is null.

PySide2.QtNetwork.QSslKey. __ne__ ( key )
参数

key QSslKey

返回类型

bool

返回 true if this key is not equal to key other ;否则返回 false .

PySide2.QtNetwork.QSslKey. __eq__ ( key )
参数

key QSslKey

返回类型

bool

返回 true if this key is equal to other ;否则返回 false .

PySide2.QtNetwork.QSslKey. swap ( other )
参数

other QSslKey

Swaps this ssl key with other 。此函数非常快,且从不失败。

PySide2.QtNetwork.QSslKey. toDer ( [ passPhrase=QByteArray() ] )
参数

passPhrase QByteArray

返回类型

QByteArray

Returns the key in DER encoding.

passPhrase argument should be omitted as DER cannot be encrypted. It will be removed in a future version of Qt.

PySide2.QtNetwork.QSslKey. toPem ( [ passPhrase=QByteArray() ] )
参数

passPhrase QByteArray

返回类型

QByteArray

Returns the key in PEM encoding. The result is encrypted with passPhrase if the key is a private key and passPhrase is non-empty.

PySide2.QtNetwork.QSslKey. type ( )
返回类型

KeyType

Returns the type of the key (i.e., PublicKey or PrivateKey).