[root@monitor ssl.crt]# openssl x509 -in
mail.bob.com.crt -outform DER -out mail.bob.com.DER
[root@monitor ssl.crt]#
file mail.bob.com.DER
mail.bob.com.DER: data
[root@monitor
ssl.crt]#
[root@monitor ssl.crt]# openssl x509 -in
mail.bob.com.DER
unable to load
certificate
19507:error:0906D06C:PEM routines:PEM_read_bio:no start
line:pem_lib.c:632:Expecting: TRUSTED CERTIFICATE
[root@monitor ssl.crt]#
可以看到 openssl 默认是把输入的文件当成 PEM 格式,而不是 DER 格式,你必须指定
-inform 选项
[root@monitor ssl.crt]# openssl x509 -in
mail.bob.com.DER -inform DER
-----BEGIN
CERTIFICATE-----
MIICcTCCAdoCAQAwDQYJKoZIhvcNAQEEBQAwgYAxCzAJBgNVBAYTAkNOMQswCQYD
VQQIEwJHRDELMAkGA1UEBxMCR1oxDDAKBgNVBAoTA05BUDEUMBIGA1UECxMLTWFp
bnRlbmFuY2UxFjAUBgNVBAMTDW1haWwuYm9iLmNvbS4xGzAZBgkqhkiG9w0BCQEW
DGFpbG1zQHFxLmNvbTAeFw0wODAyMTkwMjE4MTBaFw0wOTAyMTgwMjE4MTBaMIGA
MQswCQYDVQQGEwJDTjELMAkGA1UECBMCR0QxCzAJBgNVBAcTAkdaMQwwCgYDVQQK
EwNOQVAxFDASBgNVBAsTC01haW50ZW5hbmNlMRYwFAYDVQQDEw1tYWlsLmJvYi5j
b20uMRswGQYJKoZIhvcNAQkBFgxhaWxtc0BxcS5jb20wgZ8wDQYJKoZIhvcNAQEB
BQADgY0AMIGJAoGBALU+HImxh60mrJJilA1dTEjZmbW+zv+ovi9MtWbKUcSWTVUV
3mWEFmg4rydWahJalaP3aTmonn1nR/8T2lkyGs4GW4nDAht+kElETiMTH62HjlFz
ww6/7gaB3UaVTTY6H2bL4/9xI1ac9uWo/sgBJ9JTVjVPpRkiy9oESSkNkrZNAgMB
AAEwDQYJKoZIhvcNAQEEBQADgYEAQXwyN1FVoDSVF1gyxw/12t005ErLw13fM++H
/vpKWY7DBW9Uyw7xs61NZwk/cXhJUx0DdtDwTSfAMzYmfSqBTLH3JGJmJBJkc5L0
EW1Lv6HKAKEyKegrx/s7Ow19l3G+jaiuXjmwV+0+QtvtZ71cKqjpii0aTdHyE/pp
C7O9F+0=
-----END
CERTIFICATE-----
[root@monitor ssl.crt]#
阅读(2373) | 评论(0) | 转发(1) |