-
Notifications
You must be signed in to change notification settings - Fork 9
/
cert_unk.rb
121 lines (115 loc) · 5.87 KB
/
cert_unk.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
require 'base64'
require 'openssl'
require 'pp'
p "=========DeviceCertificate========="
s = %Q{
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUI5RENCM2FBREFnRURBZ0VBTUEw
R0NTcUdTSWIzRFFFQkJRVUFNQUF3SGhjTk1URXdOVEV3TURrd05qVXoKV2hjTk1qRXdO
VEEzTURrd05qVXpXakFBTUlHZk1BMEdDU3FHU0liM0RRRUJBUVVBQTRHTkFEQ0JpUUtC
Z1FDcAowQlRocEFOYndLWi92eXZ2aFo5UlZiY3JqNEZ0Z05VbUR1YVMzU2RhZjB5dHJU
RTlxcXAzM0orVW0rWDBRSVVmCjV2elBuUDFoMXJhV1R5R3hlMUV3L2x5Mkc0eS9nbC9n
UmJGcFlKTnd3aWN3TnBIR3ZtY2ljaFJyalQ5MWUzemUKY0JnTGhOT0RLa3Rnb2hBdmFW
NmYzYTJtTHcrRENzejY0OGhCd2Jla0N3SURBUUFCTUEwR0NTcUdTSWIzRFFFQgpCUVVB
QTRJQkFRQUxkQWo2c1VycTBaNElMQXRpYndNc2dpNFhNT1F3aVU1dEkvVkpFeXQ3ci9z
TVIvdW5NWW81CmFKc3VJbVFPeTh0M1JDd2c1azhTekxQQ05HcUxTNmQ0VklOVGh3MTJ2
NjRxUkQ1QkFhUWxhZHBiYjc4QWszQUwKZEY3d1N2VjkvYkw2WmNLb0x4dzNaSXVwWnBa
V3BoNndSdGlhNjRHRmk3R3dIMGlrTjhNem9MMEZLbHRPOWZVdAp3azZ5RExJTzZ4SlZP
Z3A0dXZxVzIxUjYxYWtFQTBtZkJKb2tJcGVnU29vYVc3RTJGMzVsZUxLdUhFNFB3ZTRZ
Cjd0OWhDQmVLVVBERG4yRjVtRHBVSzNRM3JhWmp0SzBkdDJxUWM3KzkrclhLYXZLaGZK
MVRIOUQwc2dlbGJSTnEKTCtVNkwydjRVRlNpQzJWb0FtVDM2elVwVDFmaVhBdUUKLS0t
LS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
}
tmp = Base64.decode64(s)
p tmp
device_cert = OpenSSL::X509::Certificate.new(tmp)
pp device_cert, device_cert.extensions, device_cert.public_key
key = OpenSSL::PKey::RSA.new(device_cert.public_key)
p "modulus:#{key.n}, exponent:#{key.e}"
p "=========DevicePublicKey========="
s = %Q{
LS0tLS1CRUdJTiBSU0EgUFVCTElDIEtFWS0tLS0tCk1JR0pBb0dCQUtuUUZPR2tBMXZB
cG4rL0srK0ZuMUZWdHl1UGdXMkExU1lPNXBMZEoxcC9USzJ0TVQycXFuZmMKbjVTYjVm
UkFoUi9tL00rYy9XSFd0cFpQSWJGN1VURCtYTFliakwrQ1grQkZzV2xnazNEQ0p6QTJr
Y2ErWnlKeQpGR3VOUDNWN2ZONXdHQXVFMDRNcVMyQ2lFQzlwWHAvZHJhWXZENE1LelBy
anlFSEJ0NlFMQWdNQkFBRT0KLS0tLS1FTkQgUlNBIFBVQkxJQyBLRVktLS0tLQo=
}
tmp = Base64.decode64(s)
p tmp
key = OpenSSL::PKey::RSA.new(tmp)
p "modulus:#{key.n}, exponent:#{key.e}"
p "=========HostCertificate<========="
s = %Q{
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNlVENDQVdHZ0F3SUJBd0lCQURB
TkJna3Foa2lHOXcwQkFRVUZBREFBTUI0WERURXhNRFV4TURBNU1EWTEKTTFvWERUSXhN
RFV3TnpBNU1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LS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0t
LQo=
}
tmp = Base64.decode64(s)
p tmp
device_cert = OpenSSL::X509::Certificate.new(tmp)
pp device_cert, device_cert.extensions, device_cert.public_key
key = OpenSSL::PKey::RSA.new(device_cert.public_key)
p "modulus:#{key.n}, exponent:#{key.e}"
p "=========RootCertificate========="
s = %Q{
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJZekNDQVZlZ0F3SUJBd0lCQURB
REJnRUFNQUF3SGhjTk1URXdOVEV3TURrd05qVXpXaGNOTWpFd05UQTMKTURrd05qVXpX
akFBTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUE4NU9F
ZHNxYwpVWnlWTGxpRDVsNVJ1Q3BKaDdkTXZ1UzJGSHc2YWFSaHMrYVVrUDNwZGJZczMr
b29KQkh4UXVPYUYrSFpHTnpUCmxjalliejJqbVBQcVZXMFhzUmFJVUZvNFF3YjFkWTJp
ZzM1ZWNDUnlUSS9TaGNmeUptdWVLT1FzQ1BkaHFHamsKRFRGY0MwQVVVYXc2dVlFbjV1
cWxzcXVCdUw2SEdPeXZxOUNveVg3QmNaWFg4cGJOazFPUDN1Sm05dzU2d0xtTgo3S1kz
d2p5cWpQdDd1K2FtTGRPdVFLeEh6SllScWEvajBUUEdsUVNacCt3MVlQcERsdUF2QVBV
NnUwcGJZa2g3CjB1aXhDc2UzNVRFamlrdms4ZDNwTkJ2SUVsa3FPZjBhQ0VFZUpDd1Zj
U2tybkpObU5Sd3ZNanZFK0FUbnZIb1IKVklYakYyZ3VjLytoV1FJREFRQUJNQU1HQVFB
REFRQT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
}
tmp = Base64.decode64(s)
p tmp
device_cert = OpenSSL::X509::Certificate.new(tmp)
pp device_cert, device_cert.extensions, device_cert.public_key
key = OpenSSL::PKey::RSA.new(device_cert.public_key)
p "modulus:#{key.n}, exponent:#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