Class: TinyAppstoreConnect::Model::Certificate
- Inherits:
-
Object
- Object
- TinyAppstoreConnect::Model::Certificate
- Includes:
- TinyAppstoreConnect::Model
- Defined in:
- lib/tiny_appstore_connect/models/certificate.rb
Defined Under Namespace
Modules: CertificateType
Instance Attribute Summary collapse
-
#certificate_content ⇒ Object
Returns the value of attribute certificate_content.
-
#certificate_type ⇒ Object
Returns the value of attribute certificate_type.
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#expiratio_date ⇒ Object
Returns the value of attribute expiratio_date.
-
#name ⇒ Object
Returns the value of attribute name.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#serial_number ⇒ Object
Returns the value of attribute serial_number.
Attributes included from TinyAppstoreConnect::Model
Class Method Summary collapse
Instance Method Summary collapse
- #certificate ⇒ Object
- #full_name ⇒ Object
-
#subject ⇒ Object
def type value = subject if value.include?(‘Distribution’) return ‘Distribution’ else return ” end end.
- #team_id ⇒ Object
Methods included from TinyAppstoreConnect::Model
included, #initialize, #update_attributes, #update_include
Instance Attribute Details
#certificate_content ⇒ Object
Returns the value of attribute certificate_content.
16 17 18 |
# File 'lib/tiny_appstore_connect/models/certificate.rb', line 16 def certificate_content @certificate_content end |
#certificate_type ⇒ Object
Returns the value of attribute certificate_type.
11 12 13 |
# File 'lib/tiny_appstore_connect/models/certificate.rb', line 11 def certificate_type @certificate_type end |
#display_name ⇒ Object
Returns the value of attribute display_name.
12 13 14 |
# File 'lib/tiny_appstore_connect/models/certificate.rb', line 12 def display_name @display_name end |
#expiratio_date ⇒ Object
Returns the value of attribute expiratio_date.
15 16 17 |
# File 'lib/tiny_appstore_connect/models/certificate.rb', line 15 def expiratio_date @expiratio_date end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/tiny_appstore_connect/models/certificate.rb', line 10 def name @name end |
#platform ⇒ Object
Returns the value of attribute platform.
14 15 16 |
# File 'lib/tiny_appstore_connect/models/certificate.rb', line 14 def platform @platform end |
#serial_number ⇒ Object
Returns the value of attribute serial_number.
13 14 15 |
# File 'lib/tiny_appstore_connect/models/certificate.rb', line 13 def serial_number @serial_number end |
Class Method Details
.type ⇒ Object
74 75 76 |
# File 'lib/tiny_appstore_connect/models/certificate.rb', line 74 def self.type 'certificates' end |
Instance Method Details
#certificate ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/tiny_appstore_connect/models/certificate.rb', line 61 def certificate @certificate ||= -> () do require 'openssl' data = [ '-----BEGIN CERTIFICATE-----', certificate_content, '-----END CERTIFICATE-----' ].join("\n") OpenSSL::X509::Certificate.new(data) end.call end |
#full_name ⇒ Object
41 42 43 |
# File 'lib/tiny_appstore_connect/models/certificate.rb', line 41 def full_name subject['CN'] end |
#subject ⇒ Object
def type
value = subject['CN']
if value.include?('Distribution')
return 'Distribution'
else
return ''
end
end
53 54 55 56 57 58 59 |
# File 'lib/tiny_appstore_connect/models/certificate.rb', line 53 def subject @subject ||= certificate.subject .to_a .each_with_object({}) do |(key, value, _), obj| obj[key] = value.force_encoding('UTF-8') end end |
#team_id ⇒ Object
33 34 35 |
# File 'lib/tiny_appstore_connect/models/certificate.rb', line 33 def team_id subject['OU'] end |