feat: working skins and capes(animated capes not :( )
This commit is contained in:
19
auth/app/generate_key.py
Normal file
19
auth/app/generate_key.py
Normal file
@ -0,0 +1,19 @@
|
||||
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)
|
||||
|
||||
# Сохранение в PEM-формат
|
||||
with open("private_key.pem", "wb") as f:
|
||||
f.write(private_key.private_bytes(
|
||||
encoding=serialization.Encoding.PEM,
|
||||
format=serialization.PrivateFormat.PKCS8,
|
||||
encryption_algorithm=serialization.NoEncryption()
|
||||
))
|
||||
|
||||
with open("public_key.pem", "wb") as f:
|
||||
f.write(private_key.public_key().public_bytes(
|
||||
encoding=serialization.Encoding.PEM,
|
||||
format=serialization.PublicFormat.SubjectPublicKeyInfo
|
||||
))
|
Reference in New Issue
Block a user