直接看CERT.RSA这个pkcs7格式的文件中携带的证书信息
$ openssl pkcs7 -inform DER -in CERT.RSA -print_certs -text -noout
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
37:33:62:62:61:39:37:31:3a:31:33:64:66:32:63:66:38:32:36:64:3a:2d:38:30:30:30
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=CN, O=, OU=, CN=sunweb
Validity
Not Before: Apr 9 07:18:38 2013 GMT
Not After : Apr 10 07:18:38 2038 GMT
Subject: C=CN, O=, OU=, CN=sunweb
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:90:d2:d0:b4:d8:18:72:bd:ba:3a:78:76:f3:d9:
82:6b:2b:1f:7a:98:34:57:1f:a2:2c:43:d1:29:b7:
19:17:76:7a:5a:b2:57:11:e7:29:22:a4:3a:e2:f6:
20:a2:eb:72:4c:d8:52:53:84:4e:46:38:5a:09:bd:
1d:33:5e:dd:4d:8e:ef:c0:1a:ec:e7:d2:49:f9:01:
1e:cc:fa:74:51:8b:6c:35:d0:f0:3d:85:98:40:40:
0b:ca:b3:ad:ef:82:d9:c8:30:b7:c9:4d:bd:20:69:
bb:7a:7b:8a:17:73:1f:5e:4d:ce:aa:0f:32:a0:8f:
29:aa:b9:89:cf:09:46:51:2f
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Extended Key Usage:
Code Signing
Signature Algorithm: sha1WithRSAEncryption
2f:e4:32:a0:17:fc:ab:b8:ab:99:ee:44:79:db:d5:8e:f3:ae:
35:cb:70:af:35:aa:16:dd:aa:e9:61:be:cf:c4:d9:a1:30:4b:
ee:ec:d2:f3:6a:d0:db:e8:6f:8a:2e:4f:b3:bd:aa:c1:84:ee:
bf:00:c1:83:7d:f5:5c:0c:fc:e7:92:c8:5e:22:91:fe:05:f4:
99:0d:e9:6b:47:48:0e:08:59:ca:e6:eb:b9:3f:13:dc:47:97:
f6:df:73:1f:da:35:43:94:b3:82:cf:1a:2b:b5:b8:bf:fe:d1:
09:ae:87:93:19:fd:bc:ef:cd:e3:81:4c:19:d2:27:d7:f3:09:
58:cf
提取证书(DER格式):
$ openssl pkcs7 -inform DER -in CERT.RSA -print_certs | openssl x509 -outform DER -out CERT.cer
确实与Android读取的证书有微小差别,MD5计算不一致