mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-06-27 05:23:13 +00:00
cipher
This commit is contained in:
@ -30,6 +30,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Esiur.Security.Cryptography;
|
||||
|
||||
namespace Esiur.Security.Authority;
|
||||
public class Session
|
||||
@ -50,7 +51,9 @@ public class Session
|
||||
Authentication localAuth, remoteAuth;
|
||||
//string domain;
|
||||
|
||||
public bool Encrypted { get; set; }
|
||||
|
||||
public IKeyExchanger KeyExchanger { get; set; } = null;
|
||||
public ISymetricCipher SymetricCipher { get; set; } = null;
|
||||
|
||||
|
||||
public Session(Authentication localAuthentication, Authentication remoteAuthentication)
|
||||
|
14
Esiur/Security/Cryptography/IKeyExchanger.cs
Normal file
14
Esiur/Security/Cryptography/IKeyExchanger.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Security.Cryptography
|
||||
{
|
||||
public interface IKeyExchanger
|
||||
{
|
||||
public ushort Identifier { get; }
|
||||
public byte[] GetPublicKey();
|
||||
public byte[] ComputeSharedKey(byte[] key);
|
||||
}
|
||||
}
|
14
Esiur/Security/Cryptography/ISymetricCipher.cs
Normal file
14
Esiur/Security/Cryptography/ISymetricCipher.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Security.Cryptography
|
||||
{
|
||||
public interface ISymetricCipher
|
||||
{
|
||||
public ushort Identifier { get; }
|
||||
public byte[] Encrypt(byte[] data);
|
||||
public byte[] Decrypt(byte[] data);
|
||||
public byte[] SetKey(byte[] key);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user