Class: ThePlaidApi::JwkPublicKey
- Defined in:
- lib/the_plaid_api/models/jwk_public_key.rb
Overview
A JSON Web Key (JWK) that can be used in conjunction with [JWT libraries](jwt.io/#libraries-io) to verify Plaid webhooks
Instance Attribute Summary collapse
-
#alg ⇒ String
The alg member identifies the cryptographic algorithm family used with the key.
-
#created_at ⇒ Integer
The timestamp when the key was created, in Unix time.
-
#crv ⇒ String
The crv member identifies the cryptographic curve used with the key.
-
#expired_at ⇒ Integer
The timestamp when the key expired, in Unix time.
-
#kid ⇒ String
The kid (Key ID) member can be used to match a specific key.
-
#kty ⇒ String
The kty (key type) parameter identifies the cryptographic algorithm family used with the key, such as RSA or EC.
-
#use ⇒ String
The use (public key use) parameter identifies the intended use of the public key.
-
#x ⇒ String
The x member contains the x coordinate for the elliptic curve point, provided as a base64url-encoded string of the coordinate’s big endian representation.
-
#y ⇒ String
The y member contains the y coordinate for the elliptic curve point, provided as a base64url-encoded string of the coordinate’s big endian representation.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(alg:, crv:, kid:, kty:, use:, x:, y:, created_at:, expired_at:, additional_properties: nil) ⇒ JwkPublicKey
constructor
A new instance of JwkPublicKey.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(alg:, crv:, kid:, kty:, use:, x:, y:, created_at:, expired_at:, additional_properties: nil) ⇒ JwkPublicKey
Returns a new instance of JwkPublicKey.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 85 def initialize(alg:, crv:, kid:, kty:, use:, x:, y:, created_at:, expired_at:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @alg = alg @crv = crv @kid = kid @kty = kty @use = use @x = x @y = y @created_at = created_at @expired_at = expired_at @additional_properties = additional_properties end |
Instance Attribute Details
#alg ⇒ String
The alg member identifies the cryptographic algorithm family used with the key.
16 17 18 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 16 def alg @alg end |
#created_at ⇒ Integer
The timestamp when the key was created, in Unix time.
52 53 54 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 52 def created_at @created_at end |
#crv ⇒ String
The crv member identifies the cryptographic curve used with the key.
20 21 22 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 20 def crv @crv end |
#expired_at ⇒ Integer
The timestamp when the key expired, in Unix time.
56 57 58 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 56 def expired_at @expired_at end |
#kid ⇒ String
The kid (Key ID) member can be used to match a specific key. This can be used, for instance, to choose among a set of keys within the JWK during key rollover.
26 27 28 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 26 def kid @kid end |
#kty ⇒ String
The kty (key type) parameter identifies the cryptographic algorithm family used with the key, such as RSA or EC.
31 32 33 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 31 def kty @kty end |
#use ⇒ String
The use (public key use) parameter identifies the intended use of the public key.
36 37 38 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 36 def use @use end |
#x ⇒ String
The x member contains the x coordinate for the elliptic curve point, provided as a base64url-encoded string of the coordinate’s big endian representation.
42 43 44 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 42 def x @x end |
#y ⇒ String
The y member contains the y coordinate for the elliptic curve point, provided as a base64url-encoded string of the coordinate’s big endian representation.
48 49 50 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 48 def y @y end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 103 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. alg = hash.key?('alg') ? hash['alg'] : nil crv = hash.key?('crv') ? hash['crv'] : nil kid = hash.key?('kid') ? hash['kid'] : nil kty = hash.key?('kty') ? hash['kty'] : nil use = hash.key?('use') ? hash['use'] : nil x = hash.key?('x') ? hash['x'] : nil y = hash.key?('y') ? hash['y'] : nil created_at = hash.key?('created_at') ? hash['created_at'] : nil expired_at = hash.key?('expired_at') ? hash['expired_at'] : nil # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. JwkPublicKey.new(alg: alg, crv: crv, kid: kid, kty: kty, use: use, x: x, y: y, created_at: created_at, expired_at: expired_at, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 59 def self.names @_hash = {} if @_hash.nil? @_hash['alg'] = 'alg' @_hash['crv'] = 'crv' @_hash['kid'] = 'kid' @_hash['kty'] = 'kty' @_hash['use'] = 'use' @_hash['x'] = 'x' @_hash['y'] = 'y' @_hash['created_at'] = 'created_at' @_hash['expired_at'] = 'expired_at' @_hash end |
.nullables ⇒ Object
An array for nullable fields
79 80 81 82 83 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 79 def self.nullables %w[ expired_at ] end |
.optionals ⇒ Object
An array for optional fields
74 75 76 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 74 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
146 147 148 149 150 151 152 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 146 def inspect class_name = self.class.name.split('::').last "<#{class_name} alg: #{@alg.inspect}, crv: #{@crv.inspect}, kid: #{@kid.inspect}, kty:"\ " #{@kty.inspect}, use: #{@use.inspect}, x: #{@x.inspect}, y: #{@y.inspect}, created_at:"\ " #{@created_at.inspect}, expired_at: #{@expired_at.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
138 139 140 141 142 143 |
# File 'lib/the_plaid_api/models/jwk_public_key.rb', line 138 def to_s class_name = self.class.name.split('::').last "<#{class_name} alg: #{@alg}, crv: #{@crv}, kid: #{@kid}, kty: #{@kty}, use: #{@use}, x:"\ " #{@x}, y: #{@y}, created_at: #{@created_at}, expired_at: #{@expired_at},"\ " additional_properties: #{@additional_properties}>" end |