You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rnx #rb none #ROBOMERGE-OWNER: ryan.durand #ROBOMERGE-AUTHOR: ryan.durand #ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900 #ROBOMERGE-BOT: (v613-10869866) [CL 10870549 by ryan durand in Main branch]
53 lines
1.5 KiB
C++
53 lines
1.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "PacketHandler.h"
|
|
#include "Containers/ArrayView.h"
|
|
#include "UObject/CoreNet.h"
|
|
|
|
/**
|
|
* IEncryptionComponentInterface
|
|
*/
|
|
class PACKETHANDLER_API FEncryptionComponent : public HandlerComponent
|
|
{
|
|
public:
|
|
/**
|
|
* Constructor that forwards the name to the base HandlerComponent.
|
|
*/
|
|
explicit FEncryptionComponent(FName InName) : HandlerComponent(InName) {}
|
|
|
|
/**
|
|
* Enable encryption. Future packets that are processed by this component will be encrypted. By default, encryption is disabled.
|
|
*/
|
|
virtual void EnableEncryption() = 0;
|
|
|
|
/**
|
|
* Disable encryption. Future packets that are processed by this component will not be encrypted.
|
|
*/
|
|
virtual void DisableEncryption() = 0;
|
|
|
|
/**
|
|
* Returns true if encryption is currently enabled.
|
|
*/
|
|
virtual bool IsEncryptionEnabled() const = 0;
|
|
|
|
/**
|
|
* Sets the encryption key to be used by this component. The key must be the correct size for the encryption algorithm
|
|
* that the component implements. This should be called before EnableEncryption.
|
|
*/
|
|
UE_DEPRECATED(4.24, "Use SetEncryptionData instead")
|
|
virtual void SetEncryptionKey(TArrayView<const uint8> Key)
|
|
{
|
|
FEncryptionData EncryptionData;
|
|
EncryptionData.Key.Append(Key.GetData(), Key.Num());
|
|
SetEncryptionData(EncryptionData);
|
|
}
|
|
|
|
/**
|
|
* Sets the encryption data to be used by this component. This should be called before EnableEncryption.
|
|
*/
|
|
virtual void SetEncryptionData(const FEncryptionData& EncryptionData) = 0;
|
|
};
|