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 =

friendly name for SAN OID

"subjectAltName"

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (SubjectAlternativeName) initialize(*args)

See OpenSSL::X509::Extension#initialize



223
224
225
226
227
228
229
# File 'lib/r509/cert/extensions.rb', line 223

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



216
217
218
# File 'lib/r509/cert/extensions.rb', line 216

def dns_names
  @dns_names
end

- (Object) ip_addresses (readonly)

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



218
219
220
# File 'lib/r509/cert/extensions.rb', line 218

def ip_addresses
  @ip_addresses
end

- (Object) uris (readonly)

An array of the URI alternative names, if any



220
221
222
# File 'lib/r509/cert/extensions.rb', line 220

def uris
  @uris
end