more progress :D

This commit is contained in:
Rusty Striker 2024-12-17 20:41:30 +02:00
parent d49131bc67
commit c4524fb62e
Signed by: RustyStriker
GPG key ID: 87E4D691632DFF15
6 changed files with 210 additions and 51 deletions

View file

@ -1,6 +1,8 @@
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Security.Cryptography;
namespace Server;
@ -8,6 +10,11 @@ public class Program
{
static void Main(string[] args)
{
// Generally this key would be static but since its not production yet we can generate it every time to make sure
// the users has the key and could load it from file
RSA key = RSA.Create(2048);
File.WriteAllText("server_key.pem", key.ExportRSAPublicKeyPem());
int port = 12345;
TcpListener server = new(IPAddress.Parse("0.0.0.0"), port);
try {