下载国家根证书中心(SM2)根证书:
? ? ? ? 根证书(MIIBszCCAVegAwIBAgIIaeL+wBcKxnswDAYIKoEcz1UBg3UFADAuMQswCQYDVQQGEwJDTjEOMAwGA1UECgwFTlJDQUMxDzANBgNVBAMMBlJPT1RDQTAeFw0xMjA3MTQwMzExNTlaFw00MjA3MDcwMzExNTlaMC4xCzAJBgNVBAYTAkNOMQ4wDAYDVQQKDAVOUkNBQzEPMA0GA1UEAwwGUk9PVENBMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEMPCca6pmgcchsTf2UnBeL9rtp4nw+itk1Kzrmbnqo05lUwkwlWK+4OIrtFdAqnRTV7Q9v1htkv42TsIutzd126NdMFswHwYDVR0jBBgwFoAUTDKxl9kzG8SmBcHG5YtiW/CXdlgwDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFEwysZfZMxvEpgXBxuWLYlvwl3ZYMAwGCCqBHM9VAYN1BQADSAAwRQIgG1bSLeOXp3oB8H7b53W+CKOPl2PknmWEq/lMhtn25HkCIQDaHDgWxWFtnCrBjH16/W3Ezn7/U/Vjo5xIpDoiVhsLwg==)
命令 | 说明 | wget ?-nv "http://www.rootca.gov.cn/queryDownloadContentByIdAction?certPathId= 402849e647ecf4c30147ed60d7b40007×tampt=Tue%20Mar%2001%202022% 2019:54:53%20GMT+0800%20(%E4%B8%AD%E5%9B%BD%E6%A0%87%E5% 87%86%E6%97%B6%E9%97%B4)" ?-O "社会公众应用根证书(SM2).cer" | 下载根证书 | cat 社会公众应用根证书(SM2).cer | 查看文件内容 |
==>
?
base64解码:
命令 | 说明 | base64 -d "社会公众应用根证书(SM2).cer"? ? 1>"社会公众应用根证(SM2).der" | base64 解码 |
==>
gmssl解析证书:
命令 | 说明 | gmssl x509 -in "社会公众应用根证书(SM2).der" -inform der -text -noout | 解析查看证书 |
密钥标识符(04:30:f0:9c:6b:aa:66:81:c7:21:b1:37:f6:52:70:5e:2f:da:ed:a7:89:f0:fa:2b:64:d4:ac:eb:
?????????????????99:b9:ea:a3:4e:65:53:09:30:95:62:be:e0:e2:2b:b4:57:40:aa:74:53:57:b4:3d:bf:58:6d:92????????????????:fe:36:4e:c2:2e:b7:37:75:db)
==>
?
将证书公钥写成文件:
命令 | 说明 | echo -en "\x04\x30\xf0\x9c\x6b\xaa\x66\x81\xc7\x21\xb1\x37\xf6\x52\x70\x5e\x2f\xda \xed\xa7\x89\xf0\xfa\x2b\x64\xd4\xac\xeb\x99\xb9\xea\xa3\x4e\x65\x53\x09\x30\x95 \x62\xbe\xe0\xe2\x2b\xb4\x57\x40\xaa\x74\x53\x57\xb4\x3d\xbf\x58\x6d\x92\xfe\x36 \x4e\xc2\x2e\xb7\x37\x75\xdb" 1>pubkey.dat | 裸公钥写文件 | hexdump -C?pubkey.dat | 查看16进制 |
==>
?
SHA1计算密钥标识符:
命令 | 说明 | sha1sum pubkey.dat? | 计算SHA1 | gmssl dgst -hex -sha1 pubkey.dat | 计算SHA1 |
?
计算出来的SHA1值与证书中的密钥标识符一致.
????????(4c32b197d9331bc4a605c1c6e58b625bf0977658)
|