Skip to content

Commit

Permalink
Added subject_alt_names to the Values::Cert#as_json Hash.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Jul 31, 2023
1 parent 912a5c4 commit bd84039
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
15 changes: 8 additions & 7 deletions lib/ronin/recon/values/cert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,14 @@ def to_s
#
def as_json
{
serial: @cert.serial,
not_before: @cert.not_before,
not_after: @cert.not_after,
subject: @cert.subject.to_h,
issuer: @cert.issuer.to_h,
extensions: @cert.extensions_hash,
pem: @cert.to_pem
serial: @cert.serial,
not_before: @cert.not_before,
not_after: @cert.not_after,
subject: @cert.subject.to_h,
issuer: @cert.issuer.to_h,
extensions: @cert.extensions_hash,
subject_alt_names: @cert.subject_alt_names,
pem: @cert.to_pem
}
end

Expand Down
15 changes: 8 additions & 7 deletions spec/values/cert_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,14 @@
it "must return the Hash version of #cert" do
expect(subject.as_json).to eq(
{
serial: cert.serial,
not_before: cert.not_before,
not_after: cert.not_after,
subject: cert.subject.to_h,
issuer: cert.issuer.to_h,
extensions: cert.extensions_hash,
pem: cert.to_pem
serial: cert.serial,
not_before: cert.not_before,
not_after: cert.not_after,
subject: cert.subject.to_h,
issuer: cert.issuer.to_h,
extensions: cert.extensions_hash,
subject_alt_names: cert.subject_alt_names,
pem: cert.to_pem
}
)
end
Expand Down

0 comments on commit bd84039

Please sign in to comment.