Class: NeetoJwtEngine::EllipticKeyGeneratorService
- Inherits:
-
Object
- Object
- NeetoJwtEngine::EllipticKeyGeneratorService
- Defined in:
- app/services/neeto_jwt_engine/elliptic_key_generator_service.rb
Constant Summary collapse
- CURVES =
{ ES256: "prime256v1" }.freeze
Instance Attribute Summary collapse
-
#curve ⇒ Object
readonly
Returns the value of attribute curve.
-
#elliptic_curve_key ⇒ Object
readonly
Returns the value of attribute elliptic_curve_key.
-
#private_key ⇒ Object
readonly
Returns the value of attribute private_key.
-
#public_key ⇒ Object
readonly
Returns the value of attribute public_key.
Instance Method Summary collapse
-
#initialize(algorithm = "ES256") ⇒ EllipticKeyGeneratorService
constructor
A new instance of EllipticKeyGeneratorService.
Constructor Details
#initialize(algorithm = "ES256") ⇒ EllipticKeyGeneratorService
14 15 16 17 |
# File 'app/services/neeto_jwt_engine/elliptic_key_generator_service.rb', line 14 def initialize(algorithm = "ES256") @curve = CURVES[algorithm.to_sym] @elliptic_curve_key = OpenSSL::PKey::EC.generate(curve) end |
Instance Attribute Details
#curve ⇒ Object (readonly)
Returns the value of attribute curve.
12 13 14 |
# File 'app/services/neeto_jwt_engine/elliptic_key_generator_service.rb', line 12 def curve @curve end |
#elliptic_curve_key ⇒ Object (readonly)
Returns the value of attribute elliptic_curve_key.
12 13 14 |
# File 'app/services/neeto_jwt_engine/elliptic_key_generator_service.rb', line 12 def elliptic_curve_key @elliptic_curve_key end |
#private_key ⇒ Object (readonly)
Returns the value of attribute private_key.
12 13 14 |
# File 'app/services/neeto_jwt_engine/elliptic_key_generator_service.rb', line 12 def private_key @private_key end |
#public_key ⇒ Object (readonly)
Returns the value of attribute public_key.
12 13 14 |
# File 'app/services/neeto_jwt_engine/elliptic_key_generator_service.rb', line 12 def public_key @public_key end |