module Tailgate::Helpers

Public Class Methods

p12_to_b64(filepath) click to toggle source

Takes the filepath to your downloaded private key and returns a base 64 encoded string for embedding the key in your app

 The idea is to use this method in the rails console (or irb) to create an class like so:
class GoogleOauth
  cattr_accessor :issuer
  self.issuer = 'copy your issuer (email and put it here)'
  def self.keyfile
    require 'base64'
    Base64.decode64 "paste the output from p12_to_b64 here"
  end
end
# File lib/tailgate.rb, line 85
def self.p12_to_b64 filepath
  require 'base64'
  Base64.encode64(File.open(filepath, 'rb').read)
end