//
// CryptographyManager.cs
//
// Copyright (c) František Boháček. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace NosSmooth.Cryptography;
///
/// A storage of server and client cryptography.
///
public class CryptographyManager
{
///
/// Initializes a new instance of the class.
///
public CryptographyManager()
{
ServerWorld = new ServerWorldCryptography(0);
ServerLogin = new ServerLoginCryptography();
ClientLogin = new ClientLoginCryptography();
ClientWorld = new ClientWorldCryptography(0);
}
///
/// Gets the cryptography for server world.
///
public ICryptography ServerWorld { get; }
///
/// Gets the cryptography for server login.
///
public ICryptography ServerLogin { get; }
///
/// Gets the cryptography for client world.
///
public ICryptography ClientWorld { get; }
///
/// Gets the cryptography for client login.
///
public ICryptography ClientLogin { get; }
///
/// Gets or sets the encryption key of the connection.
///
public int EncryptionKey
{
get => ((ServerWorldCryptography)ServerWorld).EncryptionKey;
set
{
((ServerWorldCryptography)ServerWorld).EncryptionKey = value;
((ClientWorldCryptography)ClientWorld).EncryptionKey = value;
}
}
}