简体   繁体   English

如何将 .der 文件转换为 .pub?

[英]How to convert the .der file to .pub?

Late I convert the .pub file to .der file through晚了我将 .pub 文件转换为 .der 文件

ssh-keygen -f ran.pub -e -m PKCS8 | openssl pkey -pubin -outform DER -out pub.der

and current I want to convert .pub file to .der But here when I try .der file to .pem or other .pub it can't convert I tried this目前我想将 .pub 文件转换为 .der 但是在这里,当我尝试将 .der 文件转换为 .pem 或其他 .pub 时,它无法转换我试过这个

openssl x509 -inform der -in pub.der -out certificate.pem

But it will getting error但是会报错

unable to load certificate
4601439852:error:09FFF06C:PEM routines:CRYPTO_internal:no start line:/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-22.200.4/libressl-2.6/crypto/pem/pem_lib.c:683:Expecting: TRUSTED CERTIFICATE

这里的解决方案

openssl rsa -in pub.der -pubout -out pub.pem

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM