Compare commits
2 commits
379e161aa1
...
22be3bdf62
Author | SHA1 | Date | |
---|---|---|---|
![]() |
22be3bdf62 | ||
![]() |
607ac7347e |
1 changed files with 15 additions and 3 deletions
|
@ -1,10 +1,22 @@
|
||||||
from flask import *
|
from flask import *
|
||||||
import OpenSSL as ssl
|
import ssl
|
||||||
import requests
|
import requests
|
||||||
|
from Crypto.PublicKey import RSA
|
||||||
|
|
||||||
public_serv= open("./server/ssl.public.key")
|
def resetKeys(privateKeyFile, publicKeyFile):
|
||||||
data='Hello World !'
|
keys = RSA.generate(1024)
|
||||||
|
|
||||||
|
with open("ssl/" + privateKeyFile, 'wb') as privHandle:
|
||||||
|
privHandle.write(keys.export_key())
|
||||||
|
|
||||||
|
with open("ssl/" + publicKeyFile, 'wb') as pubHandle:
|
||||||
|
pubHandle.write(keys.publickey().export_key())
|
||||||
|
|
||||||
|
resetKeys("private.key", "public.key")
|
||||||
|
|
||||||
|
with open("ssl/public.key", 'r') as pubHandle:
|
||||||
|
public_serv = pubHandle.read()
|
||||||
|
|
||||||
|
print(public_serv)
|
||||||
|
|
||||||
|
data = 'Hello World !'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue