Class: SSLyze::XML::Protocol::CipherSuite

Inherits:
Object
  • Object
show all
Includes:
Types
Defined in:
lib/sslyze/xml/protocol/cipher_suite.rb,
lib/sslyze/xml/protocol/cipher_suite/key_exchange.rb

Overview

Represents the <cipherSuite> XML element.

Defined Under Namespace

Classes: KeyExchange

Constant Summary

Constants included from Types

Types::Boolean, Types::None

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ CipherSuite

Initializes the cipher suite.



22
23
24
# File 'lib/sslyze/xml/protocol/cipher_suite.rb', line 22

def initialize(node)
  @node = node
end

Instance Method Details

#anonymous?Boolean



60
61
62
# File 'lib/sslyze/xml/protocol/cipher_suite.rb', line 60

def anonymous?
  Boolean[@node['anonymous']]
end

#connection_statusString

The connection status when the cipher suite was used.



53
54
55
# File 'lib/sslyze/xml/protocol/cipher_suite.rb', line 53

def connection_status
  @connection_status ||= @node['connectionStatus']
end

#key_exchangeKeyExchange?

Key exchange information.



82
83
84
85
86
# File 'lib/sslyze/xml/protocol/cipher_suite.rb', line 82

def key_exchange
  @key_exchange ||= if (element = @node.at_xpath('keyExchange'))
                      KeyExchange.new(element)
                    end
end

#key_sizeInteger?

The key size required by the cipher suite.

Since:

  • 1.0.0



71
72
73
74
75
# File 'lib/sslyze/xml/protocol/cipher_suite.rb', line 71

def key_size
  @key_size ||= if (value = @node['keySize'])
                  value.to_i
                end
end

#nameString Also known as: rfc_name, to_s

The cipher suite name.



31
32
33
# File 'lib/sslyze/xml/protocol/cipher_suite.rb', line 31

def name
  @name ||= @node['name']
end

#openssl_nameString?

Maps the RFC cipher name to it's OpenSSL name.

Since:

  • 1.0.0



44
45
46
# File 'lib/sslyze/xml/protocol/cipher_suite.rb', line 44

def openssl_name
  CipherSuites::OPENSSL_NAMES[rfc_name]
end