OpenDDS  Snapshot(2023/04/28-20:55)
SignedDocument.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_SIGNEDDOCUMENT_H
7 #define OPENDDS_DCPS_SECURITY_SSL_SIGNEDDOCUMENT_H
8 
9 #include "Certificate.h"
10 
12 #include <dds/DCPS/unique_ptr.h>
13 #include <dds/DdsSecurityCoreC.h>
14 
15 #include <openssl/pkcs7.h>
16 
17 #include <string>
18 
20 
21 namespace OpenDDS {
22 namespace Security {
23 namespace SSL {
24 
26 public:
27  explicit SignedDocument(const DDS::OctetSeq& src);
28 
30  virtual ~SignedDocument();
31 
32  bool load(const std::string& uri, DDS::Security::SecurityException& ex);
33  bool verify(const Certificate& ca);
34 
35  const DDS::OctetSeq& original() const {return original_;}
36  const std::string& content() const {return content_;}
37  bool verified() const { return verified_; }
38  const std::string& filename() const {return filename_;}
39 
40  bool operator==(const SignedDocument& other) const;
41 
42 private:
43  void load_file(const std::string& path);
44 
46  std::string content_;
47  bool verified_;
48  std::string filename_;
49 };
50 
51 } // namespace SSL
52 } // namespace Security
53 } // namespace OpenDDS
54 
56 
57 #endif
static int load
bool operator==(const Certificate &lhs, const Certificate &rhs)
const std::string & filename() const
const std::string & content() const
sequence< octet > OctetSeq
Definition: DdsDcpsCore.idl:64
#define OpenDDS_Security_Export
const DDS::OctetSeq & original() const
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28