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



389
390
391
392
393
394
395
396
397
# File 'lib/r509/cert/extensions.rb', line 389

def initialize(*args)
  super(*args)

  data = R509::ASN1.get_extension_payload(self)
  @general_names = R509::ASN1::GeneralNames.new
  data.entries.each do |gn|
    @general_names.add_item(gn)
  end
end

Instance Attribute Details

- (Object) general_names (readonly)

Returns the value of attribute general_names



386
387
388
# File 'lib/r509/cert/extensions.rb', line 386

def general_names
  @general_names
end

Instance Method Details

- (Array<R509::Subject>) directory_names

Directory names

Returns:



420
421
422
# File 'lib/r509/cert/extensions.rb', line 420

def directory_names
  @general_names.directory_names
end

- (Array<String>) dns_names

DNS names

Returns:

  • (Array<String>)

    DNS names



400
401
402
# File 'lib/r509/cert/extensions.rb', line 400

def dns_names
  @general_names.dns_names
end

- (Array<String>) ip_addresses

IP addresses formatted as dotted quad

Returns:

  • (Array<String>)

    IP addresses formatted as dotted quad



405
406
407
# File 'lib/r509/cert/extensions.rb', line 405

def ip_addresses
  @general_names.ip_addresses
end

- (Array) names

Array of GeneralName objects preserving order found in the extension

Returns:

  • (Array)

    array of GeneralName objects preserving order found in the extension



425
426
427
# File 'lib/r509/cert/extensions.rb', line 425

def names
  @general_names.names
end

- (Array<String>) rfc_822_names

Email addresses

Returns:

  • (Array<String>)

    email addresses



410
411
412
# File 'lib/r509/cert/extensions.rb', line 410

def rfc_822_names
  @general_names.rfc_822_names
end

- (Array<String>) uris

URIs (not typically found in SAN extensions)

Returns:

  • (Array<String>)

    URIs (not typically found in SAN extensions)



415
416
417
# File 'lib/r509/cert/extensions.rb', line 415

def uris
  @general_names.uris
end