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

标签 ssl encryption openssl aes openssh

后期我把.pub文件转成.der文件通过

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

目前我想将 .pub 文件转换为 .der 但是在这里,当我尝试将 .der 文件转换为 .pem 或其他 .pub 时,它无法转换 这个我试过了

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

但是会报错

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

关于ssl - 如何将 .der 文件转换为 .pub?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55375329/

相关文章:

azure - 由于 ssl 错误,无法在 azure vm 上下载包含 Chocolatey 的软件包

python - 如何解决AttributeError : SMTP_SSL instance has no attribute '__exit__' in Python?

我可以在 ZeroMQ 中交换私钥和公钥吗

linux - 在 linux Ubuntu 中,使用 apache2,我需要在单个域中托管多个网站,但使用 ssl 端口

php - 从手机到网站的客户端/服务器安全

c - 从文本文件扫描

windows-7 - 在 Windows 7 中使用 OpenSSL 的问题

cocoa - 如何在 Xcode 中将 OpenSSL 与我的应用程序静态链接?

android - 一个自签名证书来统治他们? Chrome、Android 和 iOS

java - SSLHandshakeException - java.security.cert.CertPathValidatorException : non-null policy tree required and policy tree is null