Class: OCI::Apigateway::Models::JsonWebKey
- Inherits:
-
StaticPublicKey
- Object
- StaticPublicKey
- OCI::Apigateway::Models::JsonWebKey
- Defined in:
- lib/oci/apigateway/models/json_web_key.rb
Overview
A JSON Web Key that represents the public key used for verifying the JWT signature.
Constant Summary collapse
- KTY_ENUM =
[ KTY_RSA = 'RSA'.freeze, KTY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- USE_ENUM =
[ USE_SIG = 'sig'.freeze, USE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- KEY_OPS_ENUM =
[ KEY_OPS_VERIFY = 'verify'.freeze, KEY_OPS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Constants inherited from StaticPublicKey
Instance Attribute Summary collapse
-
#alg ⇒ String
[Required] The algorithm intended for use with this key.
-
#e ⇒ String
[Required] The base64 url encoded exponent of the RSA public key represented by this key.
-
#key_ops ⇒ Array<String>
The operations for which this key is to be used.
-
#kty ⇒ String
[Required] The key type.
-
#n ⇒ String
[Required] The base64 url encoded modulus of the RSA public key represented by this key.
-
#use ⇒ String
The intended use of the public key.
Attributes inherited from StaticPublicKey
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ JsonWebKey
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Methods inherited from StaticPublicKey
Constructor Details
#initialize(attributes = {}) ⇒ JsonWebKey
Initializes the object
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 101 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['format'] = 'JSON_WEB_KEY' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.kty = attributes[:'kty'] if attributes[:'kty'] self.use = attributes[:'use'] if attributes[:'use'] self.key_ops = attributes[:'key_ops'] if attributes[:'key_ops'] self.alg = attributes[:'alg'] if attributes[:'alg'] self.n = attributes[:'n'] if attributes[:'n'] self.e = attributes[:'e'] if attributes[:'e'] end |
Instance Attribute Details
#alg ⇒ String
[Required] The algorithm intended for use with this key.
42 43 44 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 42 def alg @alg end |
#e ⇒ String
[Required] The base64 url encoded exponent of the RSA public key represented by this key.
54 55 56 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 54 def e @e end |
#key_ops ⇒ Array<String>
The operations for which this key is to be used.
38 39 40 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 38 def key_ops @key_ops end |
#kty ⇒ String
[Required] The key type.
30 31 32 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 30 def kty @kty end |
#n ⇒ String
[Required] The base64 url encoded modulus of the RSA public key represented by this key.
48 49 50 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 48 def n @n end |
#use ⇒ String
The intended use of the public key.
34 35 36 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 34 def use @use end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 57 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'kid': :'kid', 'format': :'format', 'kty': :'kty', 'use': :'use', 'key_ops': :'key_ops', 'alg': :'alg', 'n': :'n', 'e': :'e' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 73 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'kid': :'String', 'format': :'String', 'kty': :'String', 'use': :'String', 'key_ops': :'Array<String>', 'alg': :'String', 'n': :'String', 'e': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
177 178 179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 177 def ==(other) return true if equal?(other) self.class == other.class && kid == other.kid && format == other.format && kty == other.kty && use == other.use && key_ops == other.key_ops && alg == other.alg && n == other.n && e == other.e end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 214 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
194 195 196 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 194 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
203 204 205 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 203 def hash [kid, format, kty, use, key_ops, alg, n, e].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
247 248 249 250 251 252 253 254 255 256 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 247 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
241 242 243 |
# File 'lib/oci/apigateway/models/json_web_key.rb', line 241 def to_s to_hash.to_s end |