first rsa keygen setup
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
from cryptography.hazmat.primitives.asymmetric import rsa
|
||||||
|
from cryptography.hazmat.primitives import serialization
|
||||||
|
|
||||||
|
|
||||||
|
private_key = rsa.generate_private_key(
|
||||||
|
public_exponent=65537,
|
||||||
|
key_size=2048
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
unencrypted_pem_private_key = private_key.private_bytes(
|
||||||
|
encoding=serialization.Encoding.PEM,
|
||||||
|
format=serialization.PrivateFormat.PKCS8
|
||||||
|
,encryption_algorithm=serialization.NoEncryption()
|
||||||
|
)
|
||||||
|
|
||||||
|
unencrypted_pem_private_key.splitlines()[0]
|
||||||
Reference in New Issue
Block a user