CatapultServer  v0.5.0.1 (Elephant)
SecureSignedPacketIo.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "IoTypes.h"
23 #include "catapult/types.h"
24 
25 namespace catapult {
26  namespace crypto { class KeyPair; }
27  namespace ionet {
28  class BatchPacketReader;
29  class PacketIo;
30  }
31 }
32 
33 namespace catapult { namespace ionet {
34 
39  std::shared_ptr<PacketIo> CreateSecureSignedPacketIo(
40  const std::shared_ptr<PacketIo>& pIo,
41  const crypto::KeyPair& sourceKeyPair,
42  const Key& remoteKey,
43  uint32_t maxSignedPacketDataSize);
44 
47  std::shared_ptr<BatchPacketReader> CreateSecureSignedBatchPacketReader(
48  const std::shared_ptr<BatchPacketReader>& pReader,
49  const Key& remoteKey);
50 }}
CATAPULT_LOG
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
catapult::Hash256
utils::ByteArray< Hash256_Size, Hash256_tag > Hash256
Definition: src/catapult/types.h:47
catapult::crypto::Sha3_256
void Sha3_256(const RawBuffer &dataBuffer, Hash256 &hash) noexcept
Calculates the 256-bit SHA3 hash of dataBuffer into hash.
Definition: Hashes.cpp:81
m_maxSignedPacketDataSize
uint32_t m_maxSignedPacketDataSize
Definition: SecureSignedPacketIo.cpp:127
m_pReader
std::shared_ptr< BatchPacketReader > m_pReader
Definition: SecureSignedPacketIo.cpp:157
colorPrint.warning
def warning(*args)
Definition: colorPrint.py:10
m_remoteKey
const Key & m_remoteKey
Definition: SecureSignedPacketIo.cpp:83
SecureSignedPacketIo.h
catapult::crypto::Sha3_256_Builder
KeccakBuilder< Sha3ModeTag, Hash256_tag > Sha3_256_Builder
Sha3_256_Builder.
Definition: Hashes.h:85
catapult::ionet::PacketType
PacketType
An enumeration of known packet types.
Definition: PacketType.h:171
catapult::ionet::SocketOperationCode
SocketOperationCode
Enumeration of socket operation results.
Definition: SocketOperationCode.h:50
Hashes.h
catapult::ionet::IsPacketDataSizeValid
constexpr bool IsPacketDataSizeValid(const PacketHeader &header, size_t maxPacketDataSize)
Determines if header indicates a valid packet data size no greater than maxPacketDataSize.
Definition: PacketHeader.h:41
pReader
std::weak_ptr< ChainedSocketReader > pReader
Definition: PacketReaders.cpp:38
catapult::crypto::KeyPair
Represents a pair of private key with associated public key.
Definition: KeyPair.h:33
HexFormatter.h
catapult::ionet::CreateSecureSignedBatchPacketReader
std::shared_ptr< BatchPacketReader > CreateSecureSignedBatchPacketReader(const std::shared_ptr< BatchPacketReader > &pReader, const Key &remoteKey)
Definition: SecureSignedPacketIo.cpp:162
catapult::ionet::PacketIo::ReadCallback
consumer< SocketOperationCode, const Packet * > ReadCallback
Definition: PacketIo.h:33
Signer.h
BatchPacketReader.h
catapult::ionet::PacketPayload::Merge
static PacketPayload Merge(const std::shared_ptr< const Packet > &pPacket, const PacketPayload &payload)
Merges a packet (pPacket) and a packet payload into a new packet payload.
Definition: PacketPayload.cpp:59
catapult::ionet::CreateSecureSignedPacketIo
std::shared_ptr< PacketIo > CreateSecureSignedPacketIo(const std::shared_ptr< PacketIo > &pIo, const crypto::KeyPair &sourceKeyPair, const Key &remoteKey, uint32_t maxSignedPacketDataSize)
Definition: SecureSignedPacketIo.cpp:131
m_pIo
std::shared_ptr< PacketIo > m_pIo
Definition: SecureSignedPacketIo.cpp:124
types.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::crypto::Verify
bool Verify(const Key &publicKey, const RawBuffer &dataBuffer, const Signature &signature)
Definition: Signer.cpp:136
catapult::utils::ByteArray< Signature_Size, Signature_tag >
catapult::crypto::Sign
void Sign(const KeyPair &keyPair, const RawBuffer &dataBuffer, Signature &computedSignature)
Definition: Signer.cpp:82
m_callback
PacketIo::ReadCallback m_callback
Definition: SecureSignedPacketIo.cpp:84
catapult::Key
utils::ByteArray< Key_Size, Key_tag > Key
Definition: src/catapult/types.h:41
m_sourceKeyPair
const crypto::KeyPair & m_sourceKeyPair
Definition: SecureSignedPacketIo.cpp:125
IoTypes.h
Packet_Type
static constexpr PacketType Packet_Type
Definition: SecureSignedPacketIo.cpp:32
PacketIo.h