Class: R509::Cert::Extensions::SubjectAlternativeName

Inherits:
OpenSSL::X509::Extension
  • Object
show all
Defined in:
lib/r509/cert/extensions.rb

Overview

Implements the SubjectAlternativeName certificate extension, with methods to provide access to the components and meaning of the extension's contents.

Constant Summary

OID =
"subjectAltName"

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (SubjectAlternativeName) initialize(*args)

See OpenSSL::X509::Extension#initialize



215
216
217
218
219
220
221
# File 'lib/r509/cert/extensions.rb', line 215

def initialize(*args)
  super(*args)

  @dns_names = self.value.scan( DNS_REGEX ).map { |match| match[0] }
  @ip_addresses = self.value.scan( IP_ADDRESS_REGEX ).map { |match| match[0] }
  @uris = self.value.scan( URI_REGEX ).map { |match| match[0] }
end

Instance Attribute Details

- (Object) dns_names (readonly)

An array of the DNS alternative names, if any



208
209
210
# File 'lib/r509/cert/extensions.rb', line 208

def dns_names
  @dns_names
end

- (Object) ip_addresses (readonly)

An array of the IP-address alternative names, if any



210
211
212
# File 'lib/r509/cert/extensions.rb', line 210

def ip_addresses
  @ip_addresses
end

- (Object) uris (readonly)

An array of the URI alternative names, if any



212
213
214
# File 'lib/r509/cert/extensions.rb', line 212

def uris
  @uris
end