Class: SSLyze::XML::Certinfo::Certificate::PublicKey
- Inherits:
-
Object
- Object
- SSLyze::XML::Certinfo::Certificate::PublicKey
- Defined in:
- lib/sslyze/xml/certinfo/certificate/public_key.rb
Overview
Constant Summary collapse
- ALGORITHMS =
{ 'RSA' => :RSA, 'DSA' => :DSA, 'EllipticCurve' => :EC }
Instance Method Summary collapse
-
#algorithm ⇒ :RSA, ...
The algorithm used to generate the public-key.
-
#curve ⇒ Symbol?
The Elliptical Curve that was used.
-
#exponent ⇒ Integer?
The exponent used to generate the public-key.
-
#initialize(node) ⇒ PublicKey
constructor
Initializes the public-key information.
-
#size ⇒ Integer
The size of the public-key.
Constructor Details
#initialize(node) ⇒ PublicKey
Initializes the public-key information.
23 24 25 |
# File 'lib/sslyze/xml/certinfo/certificate/public_key.rb', line 23 def initialize(node) @node = node end |
Instance Method Details
#algorithm ⇒ :RSA, ...
The algorithm used to generate the public-key.
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/sslyze/xml/certinfo/certificate/public_key.rb', line 35 def algorithm unless @algorithm name = @node['algorithm'] @algorithm = ALGORITHMS.fetch(name) do raise(notimplementederror,"unknown public-key algorithm: #{name.inspect}") end end return @algorithm end |
#curve ⇒ Symbol?
The Elliptical Curve that was used.
63 64 65 66 67 |
# File 'lib/sslyze/xml/certinfo/certificate/public_key.rb', line 63 def curve @curve ||= if (curve = @node['curve']) curve.to_sym end end |
#exponent ⇒ Integer?
The exponent used to generate the public-key
74 75 76 77 78 |
# File 'lib/sslyze/xml/certinfo/certificate/public_key.rb', line 74 def exponent @exponent ||= if (exponent = @node['exponent']) exponent.to_i end end |
#size ⇒ Integer
The size of the public-key.
53 54 55 |
# File 'lib/sslyze/xml/certinfo/certificate/public_key.rb', line 53 def size @size ||= @node['size'].to_i end |