Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QSslKey Class

TheQSslKey class provides an interface for private and public keys.More...

Header:#include <QSslKey>
Since: Qt 4.3

Note: All functions in this class arereentrant.

Public Functions

QSslKey()
QSslKey(const QByteArray & encoded, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat encoding = QSsl::Pem, QSsl::KeyType type = QSsl::PrivateKey, const QByteArray & passPhrase = QByteArray())
QSslKey(QIODevice * device, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat encoding = QSsl::Pem, QSsl::KeyType type = QSsl::PrivateKey, const QByteArray & passPhrase = QByteArray())
QSslKey(const QSslKey & other)
~QSslKey()
QSsl::KeyAlgorithmalgorithm() const
voidclear()
Qt::HANDLEhandle() const
boolisNull() const
intlength() const
QByteArraytoDer(const QByteArray & passPhrase = QByteArray()) const
QByteArraytoPem(const QByteArray & passPhrase = QByteArray()) const
QSsl::KeyTypetype() const
booloperator!=(const QSslKey & other) const
QSslKey &operator=(const QSslKey & other)
booloperator==(const QSslKey & other) const

Detailed Description

TheQSslKey class provides an interface for private and public keys.

QSslKey provides a simple API for managing keys.

See alsoQSslSocket,QSslCertificate, andQSslCipher.

Member Function Documentation

QSslKey::QSslKey()

Constructs a null key.

See alsoisNull().

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

Constructs aQSslKey by decoding the string in the byte arrayencoded using a specifiedalgorithm andencoding format. If the encoded key is encrypted,passPhrase is used to decrypt it.type specifies whether the key is public or private.

After construction, useisNull() to check ifencoded contained a valid key.

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

Constructs aQSslKey by reading and decoding data from adevice using a specifiedalgorithm andencoding format. If the encoded key is encrypted,passPhrase is used to decrypt it.type specifies whether the key is public or private.

After construction, useisNull() to check ifdevice provided a valid key.

QSslKey::QSslKey(constQSslKey & other)

Constructs an identical copy ofother.

QSslKey::~QSslKey()

Destroys theQSslKey object.

QSsl::KeyAlgorithm QSslKey::algorithm() const

Returns the key algorithm.

void QSslKey::clear()

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

See alsoisNull().

Qt::HANDLE QSslKey::handle() const

Returns a pointer to the native key handle, if it is available; otherwise a null pointer is returned.

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.

bool QSslKey::isNull() const

Returns true if this is a null key; otherwise false.

See alsoclear().

int QSslKey::length() const

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

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

Returns the key in DER encoding. The result is encrypted withpassPhrase if the key is a private key andpassPhrase is non-empty.

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

Returns the key in PEM encoding. The result is encrypted withpassPhrase if the key is a private key andpassPhrase is non-empty.

QSsl::KeyType QSslKey::type() const

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

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

Returns true if this key is not equal to keyother; otherwise returns false.

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

Copies the contents ofother into this key, making the two keys identical.

Returns a reference to thisQSslKey.

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

Returns true if this key is equal toother; otherwise returns false.

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


[8]ページ先頭

©2009-2025 Movatter.jp