[problem]
I generated a private key with the following cmd
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.pem –nocrypt
pkcs8: Use -help for summary.
Generating RSA private key, 2048 bit long modulus (2 primes)
................+++++
...........................................+++++
e is 65537 (0x010001)
but I cannot find where is this key, so I tried the following 2 steps.
[what i tried]
Use
sudo find / -name 'rsa_key.pem'
, and I got Permission denied error.Checked the openssl folder location using
openssl version -d
, I gotOPENSSLDIR: "/opt/conda/ssl"
under this folder I only see the following files:cacert.pem cert.pem ct_log_list.cnf ct_log_list.cnf.dist misc openssl.cnf openssl.cnf.dist
Ignore this problem, go to generate public using
openssl rsa -in rsa_key.pem -pubout -out rsa_key.pub
, and I got an error.
Error message
Can't open rsa_key.pem for reading, No such file or directory
139653660292096:error:02001002:system library:fopen:No such file or
directory:crypto/bio/bss_file.c:69:fopen('rsa_key.pem','r')
139653660292096:error:2006D080:BIO routines:BIO_new_file:no such file:crypto/bio/bss_file.c:76:
unable to load Private Key
I want to know how can I fix this issue, where can I find the rsa_key.pem generated?
[Addition]
- If I generate key using
openssl genrsa -out snowflake_key 4096
, then I will find it in the current working directory - If I generate key using
$ openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
, then I can find it in the current working directory as well.