我正在尝试从证书 (.crt) 中提取公钥,但我没有走运。我需要证书中的公钥来加密消息。到目前为止,这是我得到的最接近的:
openssl x509 -inform der -in malsaleh.crt -pubkey -out certpubkey
但这似乎不对。我将此作为错误代码返回:
remnux@remnux:~$ openssl x509 -inform der -in malsaleh.crt -pubkey -out certpubkey
unable to load certificate
139680344728896:error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag:../crypto/asn1/tasn_dec.c:1149:
139680344728896:error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error:../crypto/asn1/tasn_dec.c:309:Type=X509
非常感谢任何帮助:)