Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1798477
  • 博文数量: 184
  • 博客积分: 10122
  • 博客等级: 上将
  • 技术积分: 5566
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-08 12:32
文章存档

2011年(1)

2008年(183)

我的朋友

分类: LINUX

2008-03-08 12:04:16

[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]#
阅读(2387) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~