Class: CertificateAuthority::Extensions::SubjectAlternativeName

Inherits:
Object
  • Object
show all
Includes:
ExtensionAPI
Defined in:
lib/certificate_authority/extensions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ExtensionAPI

#config_extensions

Constructor Details

#initializeSubjectAlternativeName

Returns a new instance of SubjectAlternativeName.



161
162
163
164
165
# File 'lib/certificate_authority/extensions.rb', line 161

def initialize
  self.uris = []
  self.dns_names = []
  self.ips = []
end

Instance Attribute Details

#dns_namesObject

Returns the value of attribute dns_names.



159
160
161
# File 'lib/certificate_authority/extensions.rb', line 159

def dns_names
  @dns_names
end

#ipsObject

Returns the value of attribute ips.



159
160
161
# File 'lib/certificate_authority/extensions.rb', line 159

def ips
  @ips
end

#urisObject

Returns the value of attribute uris.



159
160
161
# File 'lib/certificate_authority/extensions.rb', line 159

def uris
  @uris
end

Instance Method Details

#openssl_identifierObject



182
183
184
# File 'lib/certificate_authority/extensions.rb', line 182

def openssl_identifier
  "subjectAltName"
end

#to_sObject



186
187
188
189
190
191
192
# File 'lib/certificate_authority/extensions.rb', line 186

def to_s
  res =  self.uris.map {|u| "URI:#{u}" }
  res += self.dns_names.map {|d| "DNS:#{d}" }
  res += self.ips.map {|i| "IP:#{i}" }

  return res.join(',')
end