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BdL4EdvG+
R1qz1DKwWb+7fv0PFeI7C+9DztuP20FIo2/qlIcCgYAzfP7BS99Q6CaOMWy/gLaD
mzdPXKLWgbbmxM5LsupQ6ur/wLT1LAHqlfweSEu/hncNcfWPytPB29qnVWCEJjdJ
dPGvE/6iGkiu6O7FADCBnPve6BXUK4mRYLjXwkmPGk80Ldp8jB43pgad8dVvcuXu
ADJACs+/bOyrWWlCqcxSlQKBgCAaVTAaN8OCgmy2FKvvgDO7Txvb3Ri6Fp+HRBkq
Ugf2O5nCL9w4NEn89CJrCvtODEW7Ke/wknIkKN3SelHJdoEna/Khei7K9D6X0owC
u4fn3ci4WoosDwahG/+EHMY4G0ZbwDwiVtb22t1u1rMIckK/RUzypZF4L+U3cCxJ
/SQnAoGBANiS3QN2mdkQgoz1+0uIW6BA6brGjHiw79aqD6Wvmg/dns8e3t7gCvrG
23eWlS4LJfVvnneMjIlGxy0nuMzJOl8nRYcOp5X/esAjrfxzGbILkaiZidJYZgF4
sy9/G6XjrpSXq+vrjNzxCnoUV64sXFb8ftad6DCj9XpNTWabqfjO
-----END RSA PRIVATE KEY-----

上面是pkcs1格式的密钥,

openssl 3.0.2 convect pkcs1.pem to pkcs8.pem

openssl rsa -in rsa_pkcs1.pem 

writing RSA key
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDjdUe5IvcL1bMI
CbYQKgz+8guSgQHDCS9lggNY/D6KsoEshlnF9WdDaAFTsl7oGdBAY6bxtqVCF53I
4mCPpNFZgj2GYIw/hovDu11Xkha2W5HxGMjqFEXEbIDFv4mdNT1iv73uuq2+NIFy
xTJ0guPsDbNx2GjAH/iYpLpXnkCc2ERbGqTf4lVlKrfhCDbpV/GvBFdZXkIubnun
YvcMPKjcxtjudj7tND+3s0vwUm+sCnfbgD+4uw6L7C3shNtRbVCPEfFrGPA1CIoI
/JC2j9MmIbsgYvkj07j8ULRAsDaIonUFJs0D8BDIgVC2Amv54g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9FTPKlkXgv5TdwLEn9JCcCgYEA2JLdA3aZ2RCCjPX7S4hb
oEDpusaMeLDv1qoPpa+aD92ezx7e3uAK+sbbd5aVLgsl9W+ed4yMiUbHLSe4zMk6
XydFhw6nlf96wCOt/HMZsguRqJmJ0lhmAXizL38bpeOulJer6+uM3PEKehRXrixc
Vvx+1p3oMKP1ek1NZpup+M4=
-----END PRIVATE KEY-----

openssl 3.0.2 cannot convert pkcs8.pem to pkcs1.pem

openssl rsa -in pkcs8.pem -out pkcs1.pem

in openssl 1.1.1 is ok.
in openssl 3.0.2 is not work...

本文链接地址:https://const.net.cn/694.html

标签: none

添加新评论