-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunServer.py
More file actions
27 lines (22 loc) · 730 Bytes
/
runServer.py
File metadata and controls
27 lines (22 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
########## Server
from biblioteca import Biblioteca
import time
# Read Server's Private and Public Keys to load VotingServer
def loadVotingServer():
usersPubKeys = 'usersPubKeys.json'
userInfoFilePath = None
with open('./keys/server.pem', 'rb') as privateKey:
with open('./keys/server.pub', 'rb') as publicKey:
return Biblioteca(
'localhost',
9595,
publicKey.read(),
userInfoFilePath,
usersCredentials=usersPubKeys,
serverPrivateKey=privateKey.read(),
protocolMode='server'
)
vs = loadVotingServer()
while True:
print("Running Server")
vs.listenClients()