diff options
author | MÃ¥rten Nordheim <marten.nordheim@qt.io> | 2018-01-19 12:27:58 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-04-23 12:55:45 +0000 |
commit | 72bb1d95fd99ece1c79223ad889fc7dbddcc36c6 (patch) | |
tree | a8619d84f314e1c33362f519a3c47fca6a209248 /src/network/ssl/qpassworddigestor.h | |
parent | c45802e33a564bfca4745e31193bc1c2fb3520fa (diff) |
Introduce QPasswordDigestor functions
Added a few functions to derive keys from passwords. Currently it
supports PBKDF1 and PBKDF2 as defined in
RFC 8018 ( https://tools.ietf.org/html/rfc8018 ).
[ChangeLog][QtNetwork][QPasswordDigestor] Added QPasswordDigestor
Task-number: QTBUG-30550
Change-Id: I2166b518bd8b54e3486514166e76fd9ba2f219c8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network/ssl/qpassworddigestor.h')
-rw-r--r-- | src/network/ssl/qpassworddigestor.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/network/ssl/qpassworddigestor.h b/src/network/ssl/qpassworddigestor.h new file mode 100644 index 0000000000..0f88643298 --- /dev/null +++ b/src/network/ssl/qpassworddigestor.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPASSWORDDIGESTOR_H +#define QPASSWORDDIGESTOR_H + +#include <QtNetwork/qtnetworkglobal.h> +#include <QtCore/QByteArray> +#include <QtCore/QCryptographicHash> + +QT_BEGIN_NAMESPACE + +namespace QPasswordDigestor { +Q_NETWORK_EXPORT QByteArray deriveKeyPbkdf1(QCryptographicHash::Algorithm algorithm, + const QByteArray &password, const QByteArray &salt, + int iterations, quint64 dkLen); +Q_NETWORK_EXPORT QByteArray deriveKeyPbkdf2(QCryptographicHash::Algorithm algorithm, + const QByteArray &password, const QByteArray &salt, + int iterations, quint64 dkLen); +} // namespace QPasswordDigestor + +QT_END_NAMESPACE + +#endif // QPASSWORDDIGESTOR_H |