Код:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import binascii
import rsa.randnum
import cryptography
from Crypto.Cipher import Salsa20
from cryptography.fernet import Fernet, MultiFernet
import base64
import qrcode
import image
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa, padding
from cryptography.hazmat.backends import default_backend
from authlib.specs.rfc7519 import jwt
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography import x509
from cryptography.hazmat.primitives.hashes import HashContext
private_key = rsa.generate_private_key(
public_exponent=65537,
key_size=2048,
backend=default_backend()
)
class Key_Private():
def __init__(self, private_key):
self.__private_key = private_key
def private_key_funct(self):
return self.__private_key
def __str__(self):
return f'Your private key: {0}'.format(self.__private_key)
new_private_key = Key_Private(private_key)
print(new_private_key)
Отображает Your private key: 0, как сделать так что бы выходил приватный ключ?