Line data Source code
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 : 11 : #include <dds/DCPS/security/OpenDDS_Security_Export.h> 12 : #include <dds/DCPS/unique_ptr.h> 13 : #include <dds/DdsSecurityCoreC.h> 14 : 15 : #include <openssl/pkcs7.h> 16 : 17 : #include <string> 18 : 19 : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 20 : 21 : namespace OpenDDS { 22 : namespace Security { 23 : namespace SSL { 24 : 25 : class OpenDDS_Security_Export SignedDocument { 26 : public: 27 : explicit SignedDocument(const DDS::OctetSeq& src); 28 : 29 : SignedDocument(); 30 : virtual ~SignedDocument(); 31 : 32 : bool load(const std::string& uri, DDS::Security::SecurityException& ex); 33 : bool verify(const Certificate& ca); 34 : 35 67 : const DDS::OctetSeq& original() const {return original_;} 36 50 : const std::string& content() const {return content_;} 37 : bool verified() const { return verified_; } 38 50 : 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 : 45 : DDS::OctetSeq original_; 46 : std::string content_; 47 : bool verified_; 48 : std::string filename_; 49 : }; 50 : 51 : } // namespace SSL 52 : } // namespace Security 53 : } // namespace OpenDDS 54 : 55 : OPENDDS_END_VERSIONED_NAMESPACE_DECL 56 : 57 : #endif