Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python create pem file

from Cryptodome.PublicKey import RSA
key = RSA.generate(2048)
pv_key_string = key.exportKey()
with open ("private.pem", "w") as prv_file:
    print("{}".format(pv_key_string.decode()), file=prv_file)

pb_key_string = key.publickey().exportKey()
 with open ("public.pem", "w") as pub_file:
    print("{}".format(pb_key_string.decode()), file=pub_file)
Comment

PREVIOUS NEXT
Code Example
Python :: black jack python 
Python :: convert timestamp to period pandas 
Python :: docker run python 
Python :: numpy if zero is present 
Python :: iterrows pd 
Python :: python greater than dunder 
Python :: Passing array to methods 
Python :: check command 
Python :: program python factorial 
Python :: binary search tree implementation in python 
Python :: python calculate the power of number 
Python :: pandas trim string of all cells 
Python :: python dictionary delete based on value 
Python :: how to make python script run forever 
Python :: # unzip files 
Python :: python [] for loop 
Python :: matplotlib colormap transparent white to black 
Python :: creating python classes 
Python :: return variable python 
Python :: python get element by index 
Python :: ImportError: sys.meta_path is None, Python is likely shutting down 
Python :: remove element from pack tkinter 
Python :: date to timestamp python 
Python :: django change id to uuid 
Python :: django run manage.py from python 
Python :: python cron job virtualenv 
Python :: how to create copy of all objects in list python 
Python :: change every element of list python with map 
Python :: if condition in python lambda 
Python :: python concatenate dictionaries 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =