summaryrefslogtreecommitdiffstats
blob: cb7fb6e131cd3ce85757caf9fe0abddbf631e1bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * Copyright (c) 2010-2018 Isode Limited.
 * All rights reserved.
 * See the COPYING file for more information.
 */

#pragma once

#include <boost/optional.hpp>

#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeByteArray.h>
#include <Swiften/TLS/Certificate.h>
#include <Swiften/TLS/PrivateKey.h>

namespace Swift {
    class SWIFTEN_API CertificateFactory {
        public:
            virtual ~CertificateFactory();

            virtual Certificate* createCertificateFromDER(const ByteArray& der) = 0;
            virtual std::vector<Certificate::ref> createCertificateChain(const ByteArray& data);
            PrivateKey::ref createPrivateKey(const SafeByteArray& data, boost::optional<SafeByteArray> password = boost::optional<SafeByteArray>());
    };
}