Eliminate a lot of the if cases in create_user by separating them out. Add a limit to the number of users which can be created based on the license. Add support for creating and loading licenses.
This commit is contained in:
parent
0ef1902957
commit
33b43b75c0
9 changed files with 103 additions and 26 deletions
13
license.py
Normal file
13
license.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
import pickle
|
||||
|
||||
from Crypto.PublicKey import RSA
|
||||
|
||||
n = 24311791124264168943780535074639421876317270880681911499019414944027362498498429776192966738844514582251884695124256895677070273097239290537016363098432785034818859765271229653729724078304186025013011992335454557504431888746007324285000011384941749613875855493086506022340155196030616409545906383713728780211095701026770053812741971198465120292345817928060114890913931047021503727972067476586739126160044293621653486418983183727572502888923949587290840425930251185737996066354726953382305020440374552871209809125535533731995494145421279907938079885061852265339259634996180877443852561265066616143910755505151318370667L
|
||||
e = 65537L
|
||||
|
||||
def load_license(license_path):
|
||||
decryptor = RSA.construct((n, e))
|
||||
with open(license_path, 'rb') as encrypted_license:
|
||||
decrypted_data = decryptor.encrypt(encrypted_license.read(), 0)
|
||||
|
||||
return pickle.loads(decrypted_data[0])
|
Reference in a new issue