Class: SSLyze::X509::Extensions::ExtendedKeyUsage

Inherits:
SSLyze::X509::Extension show all
Includes:
Enumerable
Defined in:
lib/sslyze/x509/extensions/extended_key_usage.rb

Overview

Represents the extendedKeyUsage X509v3 extension.

Since:

  • 1.0.0

Instance Method Summary collapse

Instance Method Details

#each {|use| ... } ⇒ Enumerator

Enumerates over the allowed extended key uses.

Yields:

  • (use)

Yield Parameters:

  • use (String)

Returns:

  • (Enumerator)

Since:

  • 1.0.0



33
34
35
# File 'lib/sslyze/x509/extensions/extended_key_usage.rb', line 33

def each(&block)
  uses.each(&block)
end

#tls_web_client_authentication?Boolean

Determines if TLS Web Client Authentication is allowed.

Returns:

  • (Boolean)

Since:

  • 1.0.0



51
52
53
# File 'lib/sslyze/x509/extensions/extended_key_usage.rb', line 51

def tls_web_client_authentication?
  uses.include?('TLS Web Client Authentication')
end

#tls_web_server_authentication?Boolean

Determines if TLS Web Server Authentication is allowed.

Returns:

  • (Boolean)

Since:

  • 1.0.0



42
43
44
# File 'lib/sslyze/x509/extensions/extended_key_usage.rb', line 42

def tls_web_server_authentication?
  uses.include?('TLS Web Server Authentication')
end

#usesArray<String>

The allowed extended key uses.

Returns:

  • (Array<String>)

Since:

  • 1.0.0



20
21
22
# File 'lib/sslyze/x509/extensions/extended_key_usage.rb', line 20

def uses
  @uses ||= value.split(', ')
end