Class: Moov::Models::Components::JSONWebKey

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
Crystalline::MetadataFields
Defined in:
lib/moov/models/components/jsonwebkey.rb

Overview

Describes an [RFC7517](datatracker.ietf.org/doc/html/rfc7517) web key.

Instance Method Summary collapse

Methods included from Crystalline::MetadataFields

#field, #fields, included, #marshal_single, #to_dict, #to_json

Constructor Details

#initialize(kty:, use: nil, key_ops: nil, alg: nil, kid: nil, crv: nil, x: nil, y: nil, n: nil, e: nil) ⇒ JSONWebKey

Returns a new instance of JSONWebKey.



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/moov/models/components/jsonwebkey.rb', line 48

def initialize(kty:, use: nil, key_ops: nil, alg: nil, kid: nil, crv: nil, x: nil, y: nil, n: nil, e: nil)
  @kty = kty
  @use = use
  @key_ops = key_ops
  @alg = alg
  @kid = kid
  @crv = crv
  @x = x
  @y = y
  @n = n
  @e = e
end

Instance Method Details

#==(other) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/moov/models/components/jsonwebkey.rb', line 62

def ==(other)
  return false unless other.is_a? self.class
  return false unless @kty == other.kty
  return false unless @use == other.use
  return false unless @key_ops == other.key_ops
  return false unless @alg == other.alg
  return false unless @kid == other.kid
  return false unless @crv == other.crv
  return false unless @x == other.x
  return false unless @y == other.y
  return false unless @n == other.n
  return false unless @e == other.e
  true
end