---> Generate private key
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out private-key2048.pem 

---> Print info about private key
openssl pkey -in private-key.pem -text

---> Generate Public key
openssl pkey -in private-key.pem -out public-key.pem -pubout

---> Print public key info
openssl pkey -in public-key.pem -pubin -text

---> using genrsa
openssl genrsa -out key.pem 1024

openssl rsa -in key.pem -text -noout

openssl rsa -in key.pem -pubout -out pub-key.pem

to encrypt key
openssl rsa -in key.pem -des3 -out enc-key.pem

------ encrypt and decrypt using rsa

openssl rsautl -encrypt -in <input_file> -inkey <llave> \
        -out <output_file>  -pubin (if only public key file)
        
openssl rsautl -decrypt -in <input_file> -inkey <llave> \
        -out <output_file>
 