Public Member Functions | Protected Member Functions | List of all members
rosbag::EncryptorBase Class Referenceabstract

#include <encryptor.h>

Inheritance diagram for rosbag::EncryptorBase:
Inheritance graph
[legend]

Public Member Functions

virtual void addFieldsToFileHeader (ros::M_string &header_fields) const =0
 Add encryptor information to bag file header. More...
 
virtual void decryptChunk (ChunkHeader const &chunk_header, Buffer &decrypted_chunk, ChunkedFile &file) const =0
 Decrypt chunk. More...
 
virtual uint32_t encryptChunk (const uint32_t chunk_size, const uint64_t chunk_data_pos, ChunkedFile &file)=0
 Encrypt chunk. More...
 
virtual void initialize (Bag const &bag, std::string const &plugin_param)=0
 Initialize encryptor. More...
 
virtual bool readEncryptedHeader (boost::function< bool(ros::Header &)> read_header, ros::Header &header, Buffer &header_buffer, ChunkedFile &file)=0
 Read encrypted header from bag file. More...
 
virtual void readFieldsFromFileHeader (ros::M_string const &header_fields)=0
 Read encryptor information from bag file header. More...
 
virtual void writeEncryptedHeader (boost::function< void(ros::M_string const &)> write_header, ros::M_string const &header_fields, ChunkedFile &file)=0
 Write encrypted header to bag file. More...
 
virtual ~EncryptorBase ()
 

Protected Member Functions

 EncryptorBase ()
 

Detailed Description

Definition at line 86 of file encryptor.h.

Constructor & Destructor Documentation

◆ EncryptorBase()

rosbag::EncryptorBase::EncryptorBase ( )
inlineprotected

Definition at line 89 of file encryptor.h.

◆ ~EncryptorBase()

virtual rosbag::EncryptorBase::~EncryptorBase ( )
inlinevirtual

Definition at line 92 of file encryptor.h.

Member Function Documentation

◆ addFieldsToFileHeader()

virtual void rosbag::EncryptorBase::addFieldsToFileHeader ( ros::M_string header_fields) const
pure virtual

Add encryptor information to bag file header.

Parameters
header_fieldsThe header fields of the bag

Called for a bag being written, this method adds encryptor-specific fields to the bag file header. Those fields are used when decrypting the bag. ENCRYPTOR_FIELD_NAME must be specified in the header except for NoEncryptor.

Implemented in rosbag::AesCbcEncryptor, and rosbag::NoEncryptor.

◆ decryptChunk()

virtual void rosbag::EncryptorBase::decryptChunk ( ChunkHeader const &  chunk_header,
Buffer decrypted_chunk,
ChunkedFile file 
) const
pure virtual

Decrypt chunk.

Parameters
chunk_headerThe header of the encrypted chunk
decrypted_chunkThe buffer where decrypted chunk is written to
fileThe bag file stream from which the encrypted chunk is read

This method reads the encrypted chunk from file stream, decrypts, and writes it to decrypted_chunk.

Implemented in rosbag::AesCbcEncryptor, and rosbag::NoEncryptor.

◆ encryptChunk()

virtual uint32_t rosbag::EncryptorBase::encryptChunk ( const uint32_t  chunk_size,
const uint64_t  chunk_data_pos,
ChunkedFile file 
)
pure virtual

Encrypt chunk.

Returns
The byte size of the encrypted chunk
Parameters
chunk_sizeThe byte size of the original chunk
chunk_data_posThe start position of the chunk data in bag file stream
fileThe bag file stream

This method reads the original chunk from [chunk_data_pos, chunk_data_pos+chunk_size), encrypts it, and writes back to the file stream starting at chunk_data_pos.

Implemented in rosbag::NoEncryptor, and rosbag::AesCbcEncryptor.

◆ initialize()

virtual void rosbag::EncryptorBase::initialize ( Bag const &  bag,
std::string const &  plugin_param 
)
pure virtual

Initialize encryptor.

Parameters
bagThe Bag instance
plugin_paramThe string parameter used while initializing the encryptor

This method is called by setEncryptorPlugin, which loads an encryptor plugin.

Implemented in rosbag::AesCbcEncryptor, and rosbag::NoEncryptor.

◆ readEncryptedHeader()

virtual bool rosbag::EncryptorBase::readEncryptedHeader ( boost::function< bool(ros::Header &)>  read_header,
ros::Header header,
Buffer header_buffer,
ChunkedFile file 
)
pure virtual

Read encrypted header from bag file.

Parameters
read_headerThe functor reading unencrypted header
headerThe header object read
header_bufferThe header buffer read
fileThe bag file stream

This method reads and decrypts encrypted header to output header object (header) and buffer (header_buffer).

Implemented in rosbag::AesCbcEncryptor, and rosbag::NoEncryptor.

◆ readFieldsFromFileHeader()

virtual void rosbag::EncryptorBase::readFieldsFromFileHeader ( ros::M_string const &  header_fields)
pure virtual

Read encryptor information from bag file header.

Parameters
header_fieldsThe header fields of the bag

Called for a bag being read, this method reads encryptor-specific fields from the bag file header.

Implemented in rosbag::AesCbcEncryptor, and rosbag::NoEncryptor.

◆ writeEncryptedHeader()

virtual void rosbag::EncryptorBase::writeEncryptedHeader ( boost::function< void(ros::M_string const &)>  write_header,
ros::M_string const &  header_fields,
ChunkedFile file 
)
pure virtual

Write encrypted header to bag file.

Parameters
write_headerThe functor writing unencrypted header
header_fieldsThe header fields to be written
fileThe bag file stream

This method encrypts given header fields, and writes them to the bag file.

Implemented in rosbag::AesCbcEncryptor, and rosbag::NoEncryptor.


The documentation for this class was generated from the following file:


rosbag_storage
Author(s): Dirk Thomas , Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:52