Class: WebAuthn::AttestationObject
- Inherits:
-
Object
- Object
- WebAuthn::AttestationObject
- Defined in:
- lib/web_authn/attestation_object.rb
Instance Attribute Summary collapse
-
#attestation_statement ⇒ Object
(also: #att_stmt)
Returns the value of attribute attestation_statement.
-
#authenticator_data ⇒ Object
(also: #auth_data)
Returns the value of attribute authenticator_data.
-
#format ⇒ Object
(also: #fmt)
Returns the value of attribute format.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs) ⇒ AttestationObject
constructor
A new instance of AttestationObject.
Constructor Details
#initialize(attrs) ⇒ AttestationObject
Returns a new instance of AttestationObject.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/web_authn/attestation_object.rb', line 12 def initialize(attrs) self.format = attrs[:fmt] self.attestation_statement = case format when 'none' nil when 'packed', 'tpm', 'android-key', 'android-safetynet', 'fido-u2f' raise NotImplementedError, "Unsupported Attestation Format: #{format}" else raise InvalidContext, 'Unknown Attestation Format' end self.authenticator_data = AuthenticatorData.decode attrs[:authData] end |
Instance Attribute Details
#attestation_statement ⇒ Object Also known as: att_stmt
Returns the value of attribute attestation_statement.
3 4 5 |
# File 'lib/web_authn/attestation_object.rb', line 3 def attestation_statement @attestation_statement end |
#authenticator_data ⇒ Object Also known as: auth_data
Returns the value of attribute authenticator_data.
3 4 5 |
# File 'lib/web_authn/attestation_object.rb', line 3 def authenticator_data @authenticator_data end |
#format ⇒ Object Also known as: fmt
Returns the value of attribute format.
3 4 5 |
# File 'lib/web_authn/attestation_object.rb', line 3 def format @format end |
Class Method Details
.decode(encoded_attestation_object) ⇒ Object
26 27 28 29 30 |
# File 'lib/web_authn/attestation_object.rb', line 26 def decode(encoded_attestation_object) new CBOR.decode( Base64.urlsafe_decode64 encoded_attestation_object ).with_indifferent_access end |