from cryptography.hazmat.primitives.asymmetric import rsa
private_key = rsa.generate_private_key(
public_exponent=65537,
key_size=2048,
backend=default_backend()
)
public_key = private_key.public_key()
I'm a beginner in cryptography and I have used the python code above to generate a private and a public key. I'm using the public key to encrypt a password.
My question is, how would I password-protect the private key using the self-signed X.509 certificate using openssl tool?