Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/google-jwt.rb
Instance Method Summary collapse
- #clean_base64_encode ⇒ Object
-
#sign(private_key) ⇒ Object
Quick method for signing strings with a key.
Instance Method Details
#clean_base64_encode ⇒ Object
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 |