OpenDDS  Snapshot(2023/04/28-20:55)
PrivateKey.h
Go to the documentation of this file.
1 /*
2  * Distributed under the OpenDDS License.
3  * See: http://www.OpenDDS.org/license.html
4  */
5 
6 #ifndef OPENDDS_DCPS_SECURITY_SSL_PRIVATEKEY_H
7 #define OPENDDS_DCPS_SECURITY_SSL_PRIVATEKEY_H
8 
10 #include <dds/DCPS/unique_ptr.h>
11 
12 #include <dds/DdsDcpsCoreC.h>
13 
14 #include <openssl/evp.h>
15 
16 #include <string>
17 #include <vector>
18 
20 
21 namespace OpenDDS {
22 namespace Security {
23 namespace SSL {
24 
26 {
27 public:
29 
30  friend OpenDDS_Security_Export bool operator==(const PrivateKey& lhs,
31  const PrivateKey& rhs);
32 
33  explicit PrivateKey(const std::string& uri, const std::string& password = "");
34 
35  PrivateKey();
36 
37  virtual ~PrivateKey();
38 
39  void load(const std::string& uri, const std::string& password = "");
40 
41  int sign(const std::vector<const DDS::OctetSeq*>& src,
42  DDS::OctetSeq& dst) const;
43 
44 private:
45  PrivateKey(const PrivateKey&);
46  PrivateKey& operator=(const PrivateKey&);
47 
48  static EVP_PKEY* EVP_PKEY_from_pem(const std::string& path,
49  const std::string& password = "");
50 
51  static EVP_PKEY* EVP_PKEY_from_pem_data(const std::string& data,
52  const std::string& password);
53 
55 };
56 
58  const PrivateKey& rhs);
59 
60 } // namespace SSL
61 } // namespace Security
62 } // namespace OpenDDS
63 
65 
66 #endif
static int load
bool operator==(const Certificate &lhs, const Certificate &rhs)
struct evp_pkey_st EVP_PKEY
sequence< octet > OctetSeq
Definition: DdsDcpsCore.idl:64
#define OpenDDS_Security_Export
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
DCPS::unique_ptr< PrivateKey > unique_ptr
Definition: PrivateKey.h:28
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28