Class: Auth0::Mixins::Validation::Algorithm::HS256
- Inherits:
-
JWTAlgorithm
- Object
- JWTAlgorithm
- Auth0::Mixins::Validation::Algorithm::HS256
- Defined in:
- lib/auth0/mixins/validation.rb
Overview
Represents the HS256 algorithm, which rely on shared secrets.
Instance Attribute Summary collapse
-
#secret ⇒ Object
Returns the value of attribute secret.
Class Method Summary collapse
-
.secret(secret) ⇒ HS256
Create a new instance passing the shared secret.
Instance Method Summary collapse
-
#initialize(secret) ⇒ HS256
constructor
A new instance of HS256.
-
#name ⇒ string
Returns the algorithm name.
Constructor Details
#initialize(secret) ⇒ HS256
Returns a new instance of HS256.
249 250 251 252 253 |
# File 'lib/auth0/mixins/validation.rb', line 249 def initialize(secret) raise Auth0::InvalidParameter, 'Must supply a valid secret' if secret.to_s.empty? @secret = secret end |
Instance Attribute Details
#secret ⇒ Object
Returns the value of attribute secret.
247 248 249 |
# File 'lib/auth0/mixins/validation.rb', line 247 def secret @secret end |
Class Method Details
.secret(secret) ⇒ HS256
Create a new instance passing the shared secret.
242 243 244 |
# File 'lib/auth0/mixins/validation.rb', line 242 def secret(secret) new secret end |
Instance Method Details
#name ⇒ string
Returns the algorithm name.
257 258 259 |
# File 'lib/auth0/mixins/validation.rb', line 257 def name 'HS256' end |