Class: Saml::Kit::Cli::CertificateReport

Inherits:
Object
  • Object
show all
Defined in:
lib/saml/kit/cli/certificate_report.rb

Constant Summary collapse

HEADER =
[
  'Subject', 'Issuer', 'Serial',
  'Not Before', 'Not After', 'Fingerprint'
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ CertificateReport

Returns a new instance of CertificateReport.



13
14
15
16
# File 'lib/saml/kit/cli/certificate_report.rb', line 13

def initialize(raw)
  @certificate = ::Xml::Kit::Certificate.new(raw, use: :unknown)
  @x509 = @certificate.x509
end

Instance Attribute Details

#certificateObject (readonly)

Returns the value of attribute certificate.



11
12
13
# File 'lib/saml/kit/cli/certificate_report.rb', line 11

def certificate
  @certificate
end

#x509Object (readonly)

Returns the value of attribute x509.



11
12
13
# File 'lib/saml/kit/cli/certificate_report.rb', line 11

def x509
  @x509
end

Instance Method Details



18
19
20
21
# File 'lib/saml/kit/cli/certificate_report.rb', line 18

def print(shell)
  shell.print_table([HEADER, body])
  shell.say(x509.to_text, :green)
end