Module: Shakha::Pairwise
- Defined in:
- lib/shakha/pairwise.rb
Constant Summary collapse
- HMAC_DIGEST =
OpenSSL::Digest::SHA256.new
Class Method Summary collapse
Class Method Details
.derive(google_sub, client_id) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/shakha/pairwise.rb', line 12 def derive(google_sub, client_id) secret = secret_key input = "#{google_sub}:#{client_id}" digest = OpenSSL::HMAC.hexdigest(HMAC_DIGEST, secret, input) "ps_#{digest}" end |