Method: Passbook::Signer#compute_cert

Defined in:
lib/passbook/signer.rb

#compute_certObject



29
30
31
32
33
34
35
36
37
38
# File 'lib/passbook/signer.rb', line 29

def compute_cert
  @key_hash = {}
  if key
    @key_hash[:key]  = OpenSSL::PKey::RSA.new File.read(key), password
    @key_hash[:cert] = OpenSSL::X509::Certificate.new File.read(certificate)
  else
    p12 = OpenSSL::PKCS12.new File.read(certificate), password
    @key_hash[:key], @key_hash[:cert] = p12.key, p12.certificate
  end
end