使用 openSSL 后找不到私钥文件
Cant find private key file after using openSSL
我正在尝试在我的 mac 上使用 openssl 来生成一个 csr。问题是私钥生成后找不到了。我认为它是在其他目录中创建的。但我找不到它。这些是我使用的命令和我收到的错误消息:
user$ openssl genrsa 2048 -out myKey.pem
Generating RSA private key, 2048 bit long modulus
........................+++
...................................+++
e is 65537 (0x10001)
-----BEGIN RSA PRIVATE KEY-----
--------
-----END RSA PRIVATE KEY-----
user$ openssl req -sha256 -new -key myKey.pem -out csr.pem
Error opening Private Key myKey.pem
921:error:02001002:system library:fopen:No such file or directory:/SourceCache/OpenSSL098/OpenSSL098- 47.1/src/crypto/bio/bss_file.c:356:fopen('myKey.pem','r')
921:error:20074002:BIO routines:FILE_CTRL:system lib:/SourceCache/OpenSSL098/OpenSSL098-47.1/src/crypto/bio/bss_file.c:358:
unable to load Private Key
如何解决这个问题?谢谢
来自docs:
numbits
- the size of the private key to generate in bits. This must be the last option specified.
您的 -out
参数被忽略。这有效:
openssl genrsa -out myKey.pem 2048
或
openssl genrsa 2048 > myKey.pem
我正在尝试在我的 mac 上使用 openssl 来生成一个 csr。问题是私钥生成后找不到了。我认为它是在其他目录中创建的。但我找不到它。这些是我使用的命令和我收到的错误消息:
user$ openssl genrsa 2048 -out myKey.pem
Generating RSA private key, 2048 bit long modulus
........................+++
...................................+++
e is 65537 (0x10001)
-----BEGIN RSA PRIVATE KEY-----
--------
-----END RSA PRIVATE KEY-----
user$ openssl req -sha256 -new -key myKey.pem -out csr.pem
Error opening Private Key myKey.pem
921:error:02001002:system library:fopen:No such file or directory:/SourceCache/OpenSSL098/OpenSSL098- 47.1/src/crypto/bio/bss_file.c:356:fopen('myKey.pem','r')
921:error:20074002:BIO routines:FILE_CTRL:system lib:/SourceCache/OpenSSL098/OpenSSL098-47.1/src/crypto/bio/bss_file.c:358:
unable to load Private Key
如何解决这个问题?谢谢
来自docs:
numbits
- the size of the private key to generate in bits. This must be the last option specified.
您的 -out
参数被忽略。这有效:
openssl genrsa -out myKey.pem 2048
或
openssl genrsa 2048 > myKey.pem