Class: U2F::ClientData
- Inherits:
-
Object
- Object
- U2F::ClientData
- Defined in:
- lib/u2f/client_data.rb
Overview
A representation of ClientData, chapter 7 fidoalliance.org/specs/fido-u2f-raw-message-formats-v1.0-rd-20141008.pdf
Constant Summary collapse
- REGISTRATION_TYP =
"navigator.id.finishEnrollment".freeze
- AUTHENTICATION_TYP =
"navigator.id.getAssertion".freeze
Instance Attribute Summary collapse
-
#challenge ⇒ Object
Returns the value of attribute challenge.
-
#origin ⇒ Object
Returns the value of attribute origin.
-
#typ ⇒ Object
(also: #type)
Returns the value of attribute typ.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#challenge ⇒ Object
Returns the value of attribute challenge.
9 10 11 |
# File 'lib/u2f/client_data.rb', line 9 def challenge @challenge end |
#origin ⇒ Object
Returns the value of attribute origin.
9 10 11 |
# File 'lib/u2f/client_data.rb', line 9 def origin @origin end |
#typ ⇒ Object Also known as: type
Returns the value of attribute typ.
9 10 11 |
# File 'lib/u2f/client_data.rb', line 9 def typ @typ end |
Class Method Details
.load_from_json(json) ⇒ Object
20 21 22 23 24 25 26 27 |
# 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 |
Instance Method Details
#authentication? ⇒ Boolean
16 17 18 |
# File 'lib/u2f/client_data.rb', line 16 def authentication? typ == AUTHENTICATION_TYP end |
#registration? ⇒ Boolean
12 13 14 |
# File 'lib/u2f/client_data.rb', line 12 def registration? typ == REGISTRATION_TYP end |