Class: SSLyze::KeyExchange

Inherits:
Object
  • Object
show all
Defined in:
lib/sslyze/key_exchange.rb

Overview

Key exchange information.

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ KeyExchange

Initializes the key exchange information.

Parameters:

  • node (Nokogiri::XML::Node)

    The <keyExchange> information.



13
14
15
# File 'lib/sslyze/key_exchange.rb', line 13

def initialize(node)
  @node = node
end

Instance Method Details

#aString

Returns:

  • (String)


20
21
22
# File 'lib/sslyze/key_exchange.rb', line 20

def a
  @a ||= @node['A']
end

#bString

Returns:

  • (String)


27
28
29
# File 'lib/sslyze/key_exchange.rb', line 27

def b
  @b ||= @node['B']
end

#cofactorInteger

Returns:

  • (Integer)


34
35
36
# File 'lib/sslyze/key_exchange.rb', line 34

def cofactor
  @cofactor ||= @node['Cofactor'].to_i
end

#dh?Boolean

Determines if DH key exchange was used.

Returns:

  • (Boolean)


92
93
94
# File 'lib/sslyze/key_exchange.rb', line 92

def dh?
  type == :DH
end

#ecdhe?Boolean

Determines if ECDHE key exchange was used.

Returns:

  • (Boolean)


101
102
103
# File 'lib/sslyze/key_exchange.rb', line 101

def ecdhe?
  type == :ECDHE
end

#field_typeString

Returns:

  • (String)


41
42
43
# File 'lib/sslyze/key_exchange.rb', line 41

def field_type
  @field_type ||= @node['Field_Type']
end

#generatorString

Returns:

  • (String)


48
49
50
# File 'lib/sslyze/key_exchange.rb', line 48

def generator
  @generator ||= @node['Generator']
end

#generator_typeSymbol

Returns:

  • (Symbol)


55
56
57
# File 'lib/sslyze/key_exchange.rb', line 55

def generator_type
  @generator ||= @node['GeneratorType'].to_sym
end

#group_sizeInteger

Returns:

  • (Integer)


62
63
64
# File 'lib/sslyze/key_exchange.rb', line 62

def group_size
  @group_size ||= @node['GroupSize'].to_i
end

#primeString

Returns:

  • (String)


69
70
71
# File 'lib/sslyze/key_exchange.rb', line 69

def prime
  @prime ||= @node['Prime']
end

#seedString

Returns:

  • (String)


76
77
78
# File 'lib/sslyze/key_exchange.rb', line 76

def seed
  @seed ||= @node['Seed']
end

#type:DH, :ECDHE

Returns:

  • (:DH, :ECDHE)


83
84
85
# File 'lib/sslyze/key_exchange.rb', line 83

def type
  @type ||= @node['Type'].to_sym
end