Class: Apnotic::ProviderToken

Inherits:
Object
  • Object
show all
Defined in:
lib/apnotic/provider_token.rb

Instance Method Summary collapse

Constructor Details

#initialize(key, team_id, key_id) ⇒ ProviderToken

Returns a new instance of ProviderToken.



7
8
9
10
11
# File 'lib/apnotic/provider_token.rb', line 7

def initialize(key, team_id, key_id)
  @key     = OpenSSL::PKey::EC.new(key)
  @team_id = team_id
  @key_id  = key_id
end

Instance Method Details

#tokenObject



13
14
15
# File 'lib/apnotic/provider_token.rb', line 13

def token
  [encode(header), encode(payload), encode(signature)].join(".")
end