OpenDDS  Snapshot(2023/04/28-20:55)
security/SSL/Utils.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_UTILS_H
7 #define OPENDDS_DCPS_SECURITY_SSL_UTILS_H
8 
9 #include "Certificate.h"
10 #include "PrivateKey.h"
11 #include "dds/DdsDcpsGuidC.h"
12 #include "dds/DdsDcpsCoreC.h"
13 #include <string>
14 
16 
17 namespace OpenDDS {
18 namespace Security {
19 namespace SSL {
20 
23  const Certificate& target);
24 
25 /**
26  * @return int 0 on success; 1 on failure.
27  */
28 OpenDDS_Security_Export int make_nonce_256(std::vector<unsigned char>& nonce);
29 
30 /**
31  * @return int 0 on success; 1 on failure.
32  */
34 
35 /// Gets byte from array as though it were shifted right one bit
36 OpenDDS_Security_Export unsigned char offset_1bit(const unsigned char array[],
37  size_t i);
38 
39 /**
40  * @return int 0 on success; 1 on failure.
41  */
42 OpenDDS_Security_Export int hash(const std::vector<const DDS::OctetSeq*>& src,
43  DDS::OctetSeq& dst);
44 
45 /**
46  * @return int 0 on success; 1 on failure.
47  */
49  DDS::OctetSeq& dst);
50 
51 /**
52  * @return int 0 on success; 1 on failure.
53  */
55  const PrivateKey& key,
56  DDS::OctetSeq& dst);
57 
58 /**
59  * @return int 0 on success; 1 on failure.
60  */
62  const Certificate& key,
63  const DDS::OctetSeq& signed_data);
64 
65 } // namespace SSL
66 } // namespace Security
67 } // namespace OpenDDS
68 
70 
71 #endif
int hash_serialized(const DDS::BinaryPropertySeq &src, DDS::OctetSeq &dst)
int make_nonce_256(std::vector< unsigned char > &nonce)
int hash(const std::vector< const DDS::OctetSeq *> &src, DDS::OctetSeq &dst)
int sign_serialized(const DDS::BinaryPropertySeq &src, const PrivateKey &key, DDS::OctetSeq &dst)
sequence< octet > key
unsigned char offset_1bit(const unsigned char array[], size_t i)
Gets byte from array as though it were shifted right one bit.
int verify_serialized(const DDS::BinaryPropertySeq &src, const Certificate &key, const DDS::OctetSeq &signed_data)
DDS::BinaryPropertySeq BinaryPropertySeq
sequence< octet > OctetSeq
Definition: DdsDcpsCore.idl:64
#define OpenDDS_Security_Export
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
int make_adjusted_guid(const OpenDDS::DCPS::GUID_t &src, OpenDDS::DCPS::GUID_t &dst, const Certificate &target)
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28