123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- #ifndef _FASTDDS_RTPS_SECURITY_CRYPTOGRAPHY_CRYPTOTRANSFORM_H_
- #define _FASTDDS_RTPS_SECURITY_CRYPTOGRAPHY_CRYPTOTRANSFORM_H_
- #include <fastdds/rtps/security/cryptography/CryptoTypes.h>
- #include <fastdds/rtps/common/CDRMessage_t.h>
- #include <fastdds/rtps/common/SerializedPayload.h>
- namespace eprosima {
- namespace fastrtps {
- namespace rtps {
- namespace security {
- class CryptoTransform
- {
- public:
- virtual ~CryptoTransform(){}
-
- virtual bool encode_serialized_payload(
- SerializedPayload_t& encoded_payload,
- std::vector<uint8_t>& extra_inline_qos,
- const SerializedPayload_t& payload,
- DatawriterCryptoHandle& sending_datawriter_crypto,
- SecurityException& exception) = 0;
-
- virtual bool encode_datawriter_submessage(
- CDRMessage_t& encoded_rtps_submessage,
- const CDRMessage_t& plain_rtps_submessage,
- DatawriterCryptoHandle& sending_datawriter_crypto,
- std::vector<DatareaderCryptoHandle*>& receiving_datareader_crypto_list,
- SecurityException& exception) = 0;
-
- virtual bool encode_datareader_submessage(
- CDRMessage_t& encoded_rtps_submessage,
- const CDRMessage_t& plain_rtps_submessage,
- DatareaderCryptoHandle& sending_datareader_crypto,
- std::vector<DatawriterCryptoHandle*>& receiving_datawriter_crypto_list,
- SecurityException& exception) = 0;
-
- virtual bool encode_rtps_message(
- CDRMessage_t& encoded_rtps_message,
- const CDRMessage_t& plain_rtps_message,
- ParticipantCryptoHandle &sending_crypto,
- std::vector<ParticipantCryptoHandle*> &receiving_crypto_list,
- SecurityException &exception) = 0;
-
- virtual bool decode_rtps_message(
- CDRMessage_t& plain_buffer,
- const CDRMessage_t& encoded_buffer,
- const ParticipantCryptoHandle &receiving_crypto,
- const ParticipantCryptoHandle &sending_crypto,
- SecurityException &exception) = 0;
-
- virtual bool preprocess_secure_submsg(
- DatawriterCryptoHandle **datawriter_crypto,
- DatareaderCryptoHandle **datareader_crypto,
- SecureSubmessageCategory_t &secure_submessage_category,
- const CDRMessage_t& encoded_rtps_submessage,
- ParticipantCryptoHandle &receiving_crypto,
- ParticipantCryptoHandle &sending_crypto,
- SecurityException &exception) = 0;
-
- virtual bool decode_datawriter_submessage(
- CDRMessage_t& plain_rtps_submessage,
- CDRMessage_t& encoded_rtps_submessage,
- DatareaderCryptoHandle &receiving_datareader_crypto,
- DatawriterCryptoHandle &sending_datawriter_crypto,
- SecurityException &exception) = 0;
-
- virtual bool decode_datareader_submessage(
- CDRMessage_t& plain_rtps_submessage,
- CDRMessage_t& encoded_rtps_submessage,
- DatawriterCryptoHandle &receiving_datawriter_crypto,
- DatareaderCryptoHandle &sending_datareader_crypto,
- SecurityException &exception) = 0;
-
- virtual bool decode_serialized_payload(
- SerializedPayload_t& plain_payload,
- const SerializedPayload_t& encoded_payload,
- const std::vector<uint8_t>& inline_qos,
- DatareaderCryptoHandle& receiving_datareader_crypto,
- DatawriterCryptoHandle& sending_datawriter_crypto,
- SecurityException& exception) = 0;
- virtual uint32_t calculate_extra_size_for_rtps_message(uint32_t number_discovered_participants) const = 0;
- virtual uint32_t calculate_extra_size_for_rtps_submessage(uint32_t number_discovered_readers) const = 0;
- virtual uint32_t calculate_extra_size_for_encoded_payload(uint32_t number_discovered_readers) const = 0;
- };
- }
- }
- }
- }
- #endif
|