OpenDDS  Snapshot(2023/04/28-20:55)
LocalAuthCredentialData.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_AUTHENTICATION_LOCALAUTHCREDENTIALDATA_H
7 #define OPENDDS_DCPS_SECURITY_AUTHENTICATION_LOCALAUTHCREDENTIALDATA_H
8 
9 #include <string>
10 
15 
16 #include "dds/DCPS/RcObject.h"
17 #include "dds/DdsDcpsCoreC.h"
18 #include "dds/DdsSecurityCoreC.h"
19 
21 
22 namespace OpenDDS {
23 namespace Security {
24 
26 {
27 public:
28  CredentialHash(const SSL::Certificate& cid, const SSL::DiffieHellman& dh, const DDS::OctetSeq& cpdata, const DDS::OctetSeq& cperm)
29  : pubcert_(cid), dh_(dh), participant_topic_data_(cpdata), permissions_data_(cperm)
30  {
31  }
32 
33  int operator()(DDS::OctetSeq& dst) const;
34 
35 private:
40 };
41 
43 public:
45 
47 
48  virtual ~LocalAuthCredentialData();
49 
50  bool load_access_permissions(const DDS::Security::PermissionsCredentialToken& src,
52 
53  bool load_credentials(const DDS::PropertySeq& props, DDS::Security::SecurityException& ex);
54 
56  {
57  return *ca_cert_;
58  }
59 
61  {
62  return *participant_cert_;
63  }
64 
66  {
67  return *participant_pkey_;
68  }
69 
71  {
72  return access_permissions_;
73  }
74 
75  bool validate() const
76  {
77  if (!participant_cert_) {
79  "(%P|%t) LocalAuthCredentialData::validate(): WARNING: participant_cert_ is null,"
80  " some of the security properties might be missing!\n"));
81  return false;
82  }
83  if (!ca_cert_) {
85  "(%P|%t) LocalAuthCredentialData::validate(): WARNING: ca_cert_ is null,"
86  " some of the security properties might be missing!\n"));
87  return false;
88  }
89  return X509_V_OK == participant_cert_->validate(*ca_cert_);
90  }
91 
92 private:
93 
98 };
99 
100 }
101 }
102 
104 
105 #endif
#define ACE_ERROR(X)
DCPS::RcHandle< LocalAuthCredentialData > shared_ptr
CredentialHash(const SSL::Certificate &cid, const SSL::DiffieHellman &dh, const DDS::OctetSeq &cpdata, const DDS::OctetSeq &cperm)
const SSL::Certificate & get_participant_cert() const
const DDS::OctetSeq & get_access_permissions() const
DDS::PropertySeq PropertySeq
Definition: RtpsCore.idl:49
LM_WARNING
sequence< octet > OctetSeq
Definition: DdsDcpsCore.idl:64
const SSL::PrivateKey & get_participant_private_key() const
#define OpenDDS_Security_Export
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
const SSL::Certificate & get_ca_cert() const
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28