Include fingerprint certificate
parent
b6055e7d90
commit
8d3c33d516
|
@ -88,7 +88,7 @@ module CryptCheck
|
|||
end
|
||||
|
||||
def fingerprint
|
||||
::OpenSSL::Digest::SHA256.hexdigest @cert.to_der
|
||||
@cert.fingerprint
|
||||
end
|
||||
|
||||
def key
|
||||
|
@ -120,10 +120,11 @@ module CryptCheck
|
|||
fingerprint: self.fingerprint,
|
||||
chain: @chain.collect do |cert|
|
||||
{
|
||||
subject: cert.subject.to_s,
|
||||
serial: cert.serial.to_s,
|
||||
issuer: cert.issuer.to_s,
|
||||
lifetime: { not_before: cert.not_before, not_after: cert.not_after }
|
||||
subject: cert.subject.to_s,
|
||||
serial: cert.serial.to_s,
|
||||
issuer: cert.issuer.to_s,
|
||||
fingerprint: cert.fingerprint,
|
||||
lifetime: { not_before: cert.not_before, not_after: cert.not_after }
|
||||
}
|
||||
end,
|
||||
key: self.key.to_h,
|
||||
|
|
|
@ -150,6 +150,12 @@ class ::OpenSSL::PKey::DH
|
|||
end
|
||||
end
|
||||
|
||||
class ::OpenSSL::X509::Certificate
|
||||
def fingerprint
|
||||
::OpenSSL::Digest::SHA256.hexdigest self.to_der
|
||||
end
|
||||
end
|
||||
|
||||
class ::OpenSSL::X509::Store
|
||||
def add_chains(chains)
|
||||
chains = [chains] unless chains.is_a? Enumerable
|
||||
|
|
Loading…
Reference in New Issue