class RbSSO::Ticket

Attributes

content[R]
signature[R]

Public Class Methods

new(content, signature, verify_key) click to toggle source
# File lib/rbsso/ticket.rb, line 16
def initialize(content, signature, verify_key)
  verify_key.verify(signature, content)
  @content = content
  @signature = signature
end
open(encoded, verify_key) click to toggle source
# File lib/rbsso/ticket.rb, line 11
def self.open(encoded, verify_key)
  decoded = Base64.urlsafe_decode64 encoded
  new decoded[64..-1], decoded[0..63], verify_key
end
sign(content, key) click to toggle source
# File lib/rbsso/ticket.rb, line 7
def self.sign(content, key)
  new content.to_s, key.sign(content.to_s), key.verify_key
end

Public Instance Methods

to_base64() click to toggle source
# File lib/rbsso/ticket.rb, line 22
def to_base64
  Base64.urlsafe_encode64(signature + content)
end