无法加载证书6300:错误:0906D06C:PEM例程:PEM_read_bio:无起始行

Ste*_*Raj 6 openssl ssl-certificate private-key

当我运行以下命令检查我的私钥PEM文件时,会弹出一个错误

unable to load certificate 6300:error:0906D06C:PEM routines:PEM_read_bio:no start line:.\crypto\pem\pem_lib.c:703:Expecting: TRUSTED CERTIFICATE

command : C:\>openssl x509 -in C:\private-key.pem -text -noout

任何的想法?

Kha*_*111 3

您正在测试私钥而不是 x509 证书。因此openssl rsa(假设它是 rsa 密钥)应如下使用:

$ openssl rsa -in testkp.pem -text
Run Code Online (Sandbox Code Playgroud)

这将打印如下内容:

Private-Key: (2048 bit)
modulus:
....
publicExponent:
privateExponent:
...
prime1:
...
prime2:
....
exponent1:
...
exponent2:
....
coefficient:
.....
writing RSA key
..
....
Run Code Online (Sandbox Code Playgroud)