Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/google-jwt.rb

Instance Method Summary collapse

Instance Method Details

#clean_base64_encodeObject



12
13
14
# File 'lib/google-jwt.rb', line 12

def clean_base64_encode
  Base64.urlsafe_encode64(self).gsub('=', '')
end

#sign(private_key) ⇒ Object

Quick method for signing strings with a key.



7
8
9
10
# File 'lib/google-jwt.rb', line 7

def sign(private_key)
  digest = OpenSSL::Digest::SHA256.new
  private_key.sign(digest, self)
end