apple_certs_info 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/apple_certs_info.rb +12 -9
- data/lib/apple_certs_info/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2118d6405e0a0a575a7d4e0d7df3926941ea4e416c3840621b436f4106016884
|
4
|
+
data.tar.gz: e1b5edff1ae416471f37d99faaaa8189f4ad9cfc5581459d373c69b26a2e2bc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a482ce9fe6c5495db9fb48aa617fd1c232fd805e5837aa4bb390539c1f6976d8c983563df9900e67b7b9958a65609316553a797e3f39b967eb8ed2a152d5f7d2
|
7
|
+
data.tar.gz: 2568a6a3a46043bd9bfc140ac94888acf98b7df74803d7f12c06acc844b130291a2eeec0da3a2d9233abf69f1f8e7d3c72397bf641b220f0f3ac80ecab0772c4
|
data/Gemfile.lock
CHANGED
data/lib/apple_certs_info.rb
CHANGED
@@ -13,11 +13,11 @@ module AppleCertsInfo
|
|
13
13
|
@debug_log
|
14
14
|
end
|
15
15
|
|
16
|
-
# Check Certificate file for iPhone/Apple
|
16
|
+
# Check Certificate file for iPhone Developer /Apple Development in the KeyChain
|
17
17
|
# @param days: limit days
|
18
18
|
def self.certificate_development_list_limit_days_for(days:)
|
19
19
|
raise "do not set days param" if days.nil?
|
20
|
-
limit_days_for(days: days, type: "
|
20
|
+
limit_days_for(days: days, type: "certificate_development")
|
21
21
|
end
|
22
22
|
|
23
23
|
# Check Certificate file for iPhone/Apple Distribution in the KeyChain
|
@@ -32,12 +32,16 @@ module AppleCertsInfo
|
|
32
32
|
limit_days_for(days: days, type: "provisioning_profile")
|
33
33
|
end
|
34
34
|
|
35
|
-
def self.
|
36
|
-
|
35
|
+
def self.certificate_development_list
|
36
|
+
list = []
|
37
|
+
list = certificate_list_for(name: "iPhone Developer")
|
38
|
+
list << certificate_list_for(name: "Apple Development")
|
37
39
|
end
|
38
40
|
|
39
41
|
def self.certificate_distribution_list
|
40
|
-
|
42
|
+
list = []
|
43
|
+
list = certificate_list_for(name: "iPhone Distribution")
|
44
|
+
list << certificate_list_for(name: "Apple Distribution")
|
41
45
|
end
|
42
46
|
|
43
47
|
def self.certificate_info_for(name:)
|
@@ -48,7 +52,6 @@ module AppleCertsInfo
|
|
48
52
|
begin
|
49
53
|
`security find-certificate -a -c "#{name}" -p > #{temp_pem_file.path}`
|
50
54
|
result = `openssl x509 -text -fingerprint -noout -in #{temp_pem_file.path}`
|
51
|
-
puts(result) if @debug_log == true
|
52
55
|
|
53
56
|
expire_datetime_match = result.match(/.*Not After :(.*)/)
|
54
57
|
raise "not exits expire date" if expire_datetime_match.nil?
|
@@ -56,7 +59,7 @@ module AppleCertsInfo
|
|
56
59
|
expire_datetime = Time.parse(expire_datetime_match[1])
|
57
60
|
|
58
61
|
cname_match = result.match(/Subject: .* CN=(.*), OU=.*/)
|
59
|
-
raise "not exists cname" if cname_match.nil?
|
62
|
+
raise "not exists cname:#{result}" if cname_match.nil?
|
60
63
|
cname = cname_match[1]
|
61
64
|
|
62
65
|
limit_days = calc_limit_days(datetime: expire_datetime)
|
@@ -114,8 +117,8 @@ module AppleCertsInfo
|
|
114
117
|
private
|
115
118
|
def self.limit_days_for(days:, type:)
|
116
119
|
case type
|
117
|
-
when "
|
118
|
-
list =
|
120
|
+
when "certificate_development" then
|
121
|
+
list = certificate_development_list
|
119
122
|
when "certificate_distribution" then
|
120
123
|
list = certificate_distribution_list
|
121
124
|
when "provisioning_profile" then
|