diff options
Diffstat (limited to 'Swiften/TLS/PKCS12Certificate.h')
-rw-r--r-- | Swiften/TLS/PKCS12Certificate.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Swiften/TLS/PKCS12Certificate.h b/Swiften/TLS/PKCS12Certificate.h index 1c8c38f..c0e01d0 100644 --- a/Swiften/TLS/PKCS12Certificate.h +++ b/Swiften/TLS/PKCS12Certificate.h @@ -4,22 +4,21 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#ifndef SWIFTEN_PKCS12Certificate_H -#define SWIFTEN_PKCS12Certificate_H +#pragma once -#include "Swiften/Base/ByteArray.h" +#include <Swiften/Base/SafeByteArray.h> namespace Swift { class PKCS12Certificate { public: PKCS12Certificate() {} - PKCS12Certificate(const std::string& filename, const std::string& password) : password_(password) { - data_.readFromFile(filename); + PKCS12Certificate(const std::string& filename, const SafeByteArray& password) : password_(password) { + readByteArrayFromFile(data_, filename); } bool isNull() const { - return data_.isEmpty(); + return data_.empty(); } const ByteArray& getData() const { @@ -30,14 +29,12 @@ namespace Swift { data_ = data; } - const std::string& getPassword() const { + const SafeByteArray& getPassword() const { return password_; } private: ByteArray data_; - std::string password_; + SafeByteArray password_; }; } - -#endif |