class U2F::ClientData

A representation of ClientData, chapter 7 fidoalliance.org/specs/fido-u2f-raw-message-formats-v1.0-rd-20141008.pdf

Constants

AUTHENTICATION_TYP
REGISTRATION_TYP

Attributes

challenge[RW]
origin[RW]
typ[RW]
type[RW]

Public Class Methods

load_from_json(json) click to toggle source
# File lib/u2f/client_data.rb, line 20
def self.load_from_json(json)
  client_data = ::JSON.parse(json)
  instance = new
  instance.typ = client_data['typ']
  instance.challenge = client_data['challenge']
  instance.origin = client_data['origin']
  instance
end

Public Instance Methods

authentication?() click to toggle source
# File lib/u2f/client_data.rb, line 16
def authentication?
  typ == AUTHENTICATION_TYP
end
registration?() click to toggle source
# File lib/u2f/client_data.rb, line 12
def registration?
  typ == REGISTRATION_TYP
end