QSslKey Class

QSslKey 클래스는 개인 키 및 공개 키에 대한 인터페이스를 제공합니다. 더 보기...

Header: #include <QSslKey>
CMake: find_package(Qt6 REQUIRED COMPONENTS Network)
target_link_libraries(mytarget PRIVATE Qt6::Network)
qmake: QT += network

참고: 이 클래스의 모든 함수는 재진입됩니다.

공용 함수

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

상세 설명

QSslKey는 키를 관리하기 위한 간단한 API를 제공합니다.

QSslSocket, QSslCertificate, QSslCipher참조하세요 .

멤버 함수 문서

QSslKey::QSslKey()

널 키를 생성합니다.

isNull()도 참조하세요 .

[explicit] QSslKey::QSslKey(Qt::HANDLE handle, QSsl::KeyType type = QSsl::PrivateKey)

유효한 기본 키 handle. type 은 키가 공개 키인지 비공개 키인지 지정합니다.

이 키에 대한 소유권은 QSslKey가 가지며 네이티브 라이브러리를 사용하여 키를 해제해서는 안 됩니다.

QSslKey::QSslKey(QIODevice *device, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat encoding = QSsl::Pem, QSsl::KeyType type = QSsl::PrivateKey, const QByteArray &passPhrase = QByteArray())

지정된 algorithmencoding 형식을 사용하여 device 에서 데이터를 읽고 해독하여 QSslKey를 구성합니다. type 은 키가 공개인지 비공개인지 지정합니다.

키가 암호화된 경우 passPhrase 를 사용하여 해독합니다.

구축 후에는 isNull()를 사용하여 device 이 유효한 키를 제공했는지 확인합니다.

QSslKey::QSslKey(const QByteArray &encoded, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat encoding = QSsl::Pem, QSsl::KeyType type = QSsl::PrivateKey, const QByteArray &passPhrase = QByteArray())

지정된 algorithmencoding 형식을 사용하여 바이트 배열 encoded 의 문자열을 디코딩하여 QSslKey를 만듭니다. type 은 키가 공개 키인지 비공개 키인지 지정합니다.

키가 암호화된 경우 passPhrase 를 사용하여 해독합니다.

구축 후 isNull()를 사용하여 encoded 에 유효한 키가 포함되어 있는지 확인합니다.

QSslKey::QSslKey(const QSslKey &other)

other 의 동일한 복사본을 생성합니다.

[noexcept] QSslKey::~QSslKey()

QSslKey 객체를 삭제합니다.

QSsl::KeyAlgorithm QSslKey::algorithm() const

키 알고리즘을 반환합니다.

void QSslKey::clear()

이 키의 내용을 지워 null 키로 만듭니다.

isNull()도 참조하세요 .

Qt::HANDLE QSslKey::handle() const

네이티브 키 핸들이 있으면 그 핸들에 대한 포인터를 반환하고, 없으면 nullptr.

이 핸들을 네이티브 API와 함께 사용하여 키에 대한 확장 정보에 액세스할 수 있습니다.

경고: 이 함수를 사용하면 이식성이 없을 가능성이 높으며, 반환값은 플랫폼마다, 그리고 마이너 Qt 릴리스마다 다를 수 있습니다.

bool QSslKey::isNull() const

null 키인 경우 true, 그렇지 않으면 false를 반환합니다.

clear()도 참조하세요 .

int QSslKey::length() const

키의 길이를 비트 단위로 반환하며, 키가 널이면 -1을 반환합니다.

[noexcept] void QSslKey::swap(QSslKey &other)

이 ssl 키를 other 로 바꿉니다. 이 작업은 매우 빠르며 실패하지 않습니다.

QByteArray QSslKey::toDer(const QByteArray &passPhrase = QByteArray()) const

DER 인코딩으로 키를 반환합니다.

passPhrase 인자는 DER을 암호화할 수 없으므로 생략해야 합니다. 이 인수는 향후 Qt 버전에서 제거될 예정입니다.

QByteArray QSslKey::toPem(const QByteArray &passPhrase = QByteArray()) const

키를 PEM 인코딩으로 반환합니다. 키가 개인 키이고 passPhrase 이 비어 있지 않은 경우 결과는 passPhrase 으로 암호화됩니다.

QSsl::KeyType QSslKey::type() const

키의 유형(예: 공개키 또는 비공개키)을 반환합니다.

bool QSslKey::operator!=(const QSslKey &other) const

이 키가 other 키와 같지 않으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

QSslKey &QSslKey::operator=(const QSslKey &other)

other 의 내용을 이 키에 복사하여 두 키를 동일하게 만듭니다.

QSslKey 에 대한 참조를 반환합니다.

bool QSslKey::operator==(const QSslKey &other) const

이 키가 other 과 같으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

© 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.