【android】apk证书信息获取

【android】apk证书信息获取,第1张

文章目录 前言1. 获取apk文件指纹信息2. 获取apk证书信息参考资料:


前言

记录一些获取apk证书信息的命令


1. 获取apk文件指纹信息

keytool --printcert --jarfile C:\Users\admin\Desktop\test.apk

结果如下:

签名者 #1:

签名:

所有者: L=CN
发布者: L=CN
序列号: 1da74ad
有效期为 Fri Nov 20 14:24:38 CST 2020 至 Tue Nov 14 14:24:38 CST 2045
证书指纹:
         MD5:  35:C4:93:2D:1D:68:4A:3C:8B:2F:47:A5:5E:DF:A6:B0
         SHA1: 72:F8:69:37:D0:6C:3D:3C:64:B3:DB:AD:62:B2:98:BE:79:DB:34:B2
         SHA256: CF:1A:DF:A4:EF:3B:91:93:DE:A0:F6:C1:50:D2:D7:95:8D:89:3D:38:F2:5C:8D:21:C2:42:2C:23:18:8A:5F:90
签名算法名称: SHA256withRSA
主体公共密钥算法: 2048 位 RSA 密钥
版本: 3

扩展:

#1: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 57 14 DB BA 85 C8 33 21   CE 33 F7 B9 3D D9 58 46  W.....3!.3..=.XF
0010: E8 DF 8A F0                                        ....
]
]
2. 获取apk证书信息

这里需要先解压apk文件,获取META-INF文件夹中的CERT.RSA文件

openssl pkcs7 -inform DER -in C:\Users\admin\Desktop\test\META-INF\CERT.RSA -noout -print_certs -text

结果如下:

Certificate:                                                                                          
    Data:                                                                                             
        Version: 3 (0x2)                                                                              
        Serial Number: 31093933 (0x1da74ad)                                                           
        Signature Algorithm: sha256WithRSAEncryption                                                  
        Issuer: L=CN                                                                                  
        Validity                                                                                      
            Not Before: Nov 20 06:24:38 2020 GMT                                                      
            Not After : Nov 14 06:24:38 2045 GMT                                                      
        Subject: L=CN                                                                                 
        Subject Public Key Info:                                                                      
            Public Key Algorithm: rsaEncryption                                                       
                RSA Public-Key: (2048 bit)                                                            
                Modulus:                                                                              
                    00:e5:9c:f0:63:d0:e5:7a:f5:2f:a2:7e:e7:a1:9c:                                     
                    c6:d3:22:4a:03:5a:34:0a:f7:ff:9e:8a:c5:d2:7f:                                     
                    98:37:fc:a9:f2:52:db:ec:a4:88:53:1b:86:26:82:                                     
                    08:28:6a:ba:b9:fb:f4:69:e1:48:40:ac:89:5e:89:                                     
                    7b:89:0a:29:3c:0b:37:74:41:40:64:db:29:ce:57:                                     
                    a7:10:cd:9c:d2:07:40:fd:0f:01:42:14:2e:c9:9e:                                     
                    d9:93:0d:2e:89:ed:fb:7c:fc:89:3f:c2:fa:cd:da:                                     
                    df:71:14:1b:5b:ed:60:ec:fe:b4:99:c7:4b:77:d0:                                     
                    a9:19:b3:4d:2e:26:3c:68:4c:dc:b5:d6:df:37:9b:                                     
                    a7:11:0c:cc:9e:4f:8e:f4:5e:bf:f4:38:01:2e:59:                                     
                    90:cb:9f:43:73:7d:35:ab:8a:7d:ef:04:30:02:f7:                                     
                    a2:dc:0f:c7:1a:9c:55:23:db:7f:a2:9b:a0:98:9e:                                     
                    e7:a9:c8:5a:15:70:93:fc:88:97:f0:8b:56:8a:2d:                                     
                    6e:2f:fa:7c:ed:9d:e2:c7:bf:24:ef:a2:81:05:a2:                                     
                    50:7e:e0:e8:2d:38:35:74:02:e4:01:18:e3:52:72:                                     
                    20:9a:24:e7:5e:d2:da:d2:b2:91:26:4f:48:4c:a2:                                     
                    a5:03:ca:22:9f:f7:44:0d:bc:41:4a:ac:7c:12:f8:                                     
                    cf:27                                                                             
                Exponent: 65537 (0x10001)                                                             
        X509v3 extensions:                                                                            
            X509v3 Subject Key Identifier:                                                            
                57:14:DB:BA:85:C8:33:21:CE:33:F7:B9:3D:D9:58:46:E8:DF:8A:F0                           
    Signature Algorithm: sha256WithRSAEncryption                                                      
         23:e6:c7:36:b3:9e:ea:34:b0:ef:05:b8:34:2a:1c:83:74:c3:                                       
         2e:3b:95:42:d8:96:9d:88:c4:51:77:a1:14:ca:ef:74:19:2d:                                       
         90:46:b0:a5:00:d2:4c:2e:d7:75:b4:4c:d2:ed:d1:5b:05:d5:                                       
         aa:a8:e3:d2:25:8a:c8:57:f4:0d:09:2f:29:35:06:db:70:04:                                       
         5c:1c:5f:2c:5a:e3:70:47:ff:7a:94:e7:f1:1c:d3:71:c6:c1:                                       
         81:2d:ae:c1:fc:b7:f8:05:9c:c1:5c:be:ad:a0:a8:de:a6:53:                                       
         20:8b:7a:bc:b9:68:3c:0f:b4:17:f3:ee:39:30:21:29:5c:5d:                                       
         ab:68:e4:2f:d3:f2:50:71:b6:0e:91:1c:c1:e9:a0:d4:1c:e7:                                       
         e7:7f:78:2a:82:21:5c:4f:2e:a9:32:46:e7:a1:e3:db:ce:28:                                       
         02:02:30:35:c5:84:e6:10:15:ae:0e:22:f6:45:38:2b:8f:85:                                       
         52:e8:e9:5f:fa:6c:a6:41:f6:24:47:32:11:d5:61:ad:fc:a0:                                       
         44:3f:93:e7:fe:48:90:af:7f:02:d7:38:f9:d7:64:c7:53:db:                                       
         54:66:70:dd:ed:29:1e:84:22:be:37:1b:27:89:11:4a:b4:45:                                       
         15:5d:a5:ab:4c:19:92:8b:51:64:2e:ef:14:55:bc:c4:d6:61:                                       
         ac:6c:94:2e                                                                                  
                                                                                                      
                                                                                                      

另外可以通过修改CERT.RSA文件名,修改后缀为.p7r后双击打开,查看其中信息

参考资料:

从CERT.RSA中提取证书
Android签名机制及PMS中校验流程

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/992971.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存