Class: WebAuthn::AttestationStatement::Packed

Inherits:
WebAuthn::AttestationStatement show all
Defined in:
lib/web_authn/attestation_statement/packed.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(alg:, sig:, x5c:, ecdaa_key_id:) ⇒ Packed

Returns a new instance of Packed.



6
7
8
9
10
11
# File 'lib/web_authn/attestation_statement/packed.rb', line 6

def initialize(alg:, sig:, x5c:, ecdaa_key_id:)
  self.alg = alg
  self.sig = sig
  self.x5c = Array(x5c)
  self.ecdaa_key_id = ecdaa_key_id
end

Instance Attribute Details

#algObject

Returns the value of attribute alg.



4
5
6
# File 'lib/web_authn/attestation_statement/packed.rb', line 4

def alg
  @alg
end

#ecdaa_key_idObject

Returns the value of attribute ecdaa_key_id.



4
5
6
# File 'lib/web_authn/attestation_statement/packed.rb', line 4

def ecdaa_key_id
  @ecdaa_key_id
end

#sigObject

Returns the value of attribute sig.



4
5
6
# File 'lib/web_authn/attestation_statement/packed.rb', line 4

def sig
  @sig
end

#x5cObject

Returns the value of attribute x5c.



4
5
6
# File 'lib/web_authn/attestation_statement/packed.rb', line 4

def x5c
  @x5c
end

Class Method Details

.decode(att_stmt) ⇒ Object



60
61
62
63
64
65
66
67
# File 'lib/web_authn/attestation_statement/packed.rb', line 60

def decode(att_stmt)
  new(
    alg: att_stmt[:alg],
    sig: att_stmt[:sig],
    x5c: att_stmt[:x5c],
    ecdaa_key_id: att_stmt[:ecdaaKeyId]
  )
end

Instance Method Details

#verify!(authenticator_data, client_data_json) ⇒ Object



13
14
15
16
# File 'lib/web_authn/attestation_statement/packed.rb', line 13

def verify!(authenticator_data, client_data_json)
  verify_signature! authenticator_data, client_data_json
  verify_certificate! unless self_issued?
end