本文介绍了无法加载私钥. (PEM例程:PEM_read_bio:无起始行:pem_lib.c:648:预期:任何私钥)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个.PEE格式的私钥文件.我没有制作这个文件,但是我从某个地方得到的.
I have a .key file which is PEM formatted private key file. I didn't make this file but I got this from somewhere.
我想使用openssl工具查看其MD5哈希值,如下所示.
I wanted to see its MD5 hash with openssl tool like below command.
openssl rsa -in server.key -modulus -noout
但这会产生以下错误.
unable to load Private Key
13440:error:0906D06C:PEM routines:PEM_read_bio:no start line:.\crypto\pem\pem_lib.c:648:Expecting: ANY PRIVATE KEY
这是.key文件的一部分asn1parse.
Here's some asn1parse of the .key file.
openssl asn1parse -in server.key
0:d=0 hl=4 l= 603 cons: SEQUENCE
4:d=1 hl=2 l= 1 prim: INTEGER :00
7:d=1 hl=3 l= 129 prim: INTEGER :C141201603899993919CBAA56985E9C7
C6A2AF713A02F5FE88D38CEFBED9304599689280B84B0AB577A9719CA20DDA1246A894AF397A2C57
EE5A582B036CC367E3667454DCD82DBDBF187C35FE39F61C71B517DDDF576F5471B4EC2E045E0F9D
619F5616C4E832F00CBD0DBF41B4BA3CBC4B4B603AE1FE61965917DA732E0DEF
139:d=1 hl=2 l= 3 prim: INTEGER :010001
144:d=1 hl=3 l= 128 prim: INTEGER :1687B9AE67562CEDEBDD7A531B84CDB7
093CE138519B93C34B7F626076FF0A262B16EA71904ACB6251A39307C04ADE202055BA13DD9F1539
6123EE408183361A9BC08B9413FA360EA928E48CC3F52B33ACF2980758F02BA2139F652F30A257C2
2E45D7C25835FC4D22B9ECECC12AB632318D4F47E1EBDAD9781B96BCFF03A2D1
...
还有什么可以尝试的吗?
Is there anything more I can try?
推荐答案
我将PEM文件的页眉和页脚更改为
I changed the header and footer of the PEM file to
-----BEGIN RSA PRIVATE KEY-----
和
-----END RSA PRIVATE KEY-----
终于可以了!
这篇关于无法加载私钥. (PEM例程:PEM_read_bio:无起始行:pem_lib.c:648:预期:任何私钥)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!