Class: EnMail::CertificateFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/enmail/certificate_finder.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email:) ⇒ CertificateFinder

Returns a new instance of CertificateFinder.



5
6
7
# File 'lib/enmail/certificate_finder.rb', line 5

def initialize(email:)
  @email = email
end

Class Method Details

.find_by_email(email) ⇒ Object

Self.find_by_email

Initialize a new instnace with more readble interface.



33
34
35
# File 'lib/enmail/certificate_finder.rb', line 33

def self.find_by_email(email)
  new(email: email)
end

Instance Method Details

#certificateObject

Certificate

This returns an ‘OpenSSL::X509::Certificate` instnace which usages the content for the pem certificate. The certificate name is the dotify version of the email with `pem` ext.



15
16
17
# File 'lib/enmail/certificate_finder.rb', line 15

def certificate
  certificate_instance
end

#private_keyObject

Private Key

This returns an ‘OpenSSL::PKey::RSA` instnace which usages the content for keyfile. The keyfile is the dotify version of the email with `key` ext.



25
26
27
# File 'lib/enmail/certificate_finder.rb', line 25

def private_key
  private_key_instance
end