Class: Ccrypto::ECCConfig
- Inherits:
-
KeypairConfig
- Object
- KeypairConfig
- Ccrypto::ECCConfig
- Defined in:
- lib/ccrypto/configs/keypair_config.rb
Overview
KeypairConfig
Constant Summary
Constants inherited from KeypairConfig
KeypairConfig::Algo_Active, KeypairConfig::Algo_Broken, KeypairConfig::Algo_NotRecommended, KeypairConfig::Algo_Obsolete
Instance Attribute Summary collapse
-
#curve ⇒ Object
Returns the value of attribute curve.
Attributes inherited from KeypairConfig
#algo, #algo_status, #default, #keypair, #private_key, #public_key
Attributes included from AlgoConfig
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(curve = nil, status = Algo_Active, default = false) ⇒ ECCConfig
constructor
A new instance of ECCConfig.
- #to_s ⇒ Object
Methods inherited from KeypairConfig
#has_keypair?, #has_private_key?, #has_public_key?, #is_default_algo?, keypair_purposes, supported_keypair_config
Methods included from AlgoConfig
Constructor Details
#initialize(curve = nil, status = Algo_Active, default = false) ⇒ ECCConfig
Returns a new instance of ECCConfig.
70 71 72 73 74 75 |
# File 'lib/ccrypto/configs/keypair_config.rb', line 70 def initialize(curve = nil, status = Algo_Active, default = false) @algo = :ecc @curve = curve || :prime256v1 @curve = @curve.to_sym if not @curve.is_a?(Symbol) super(status, default) end |
Instance Attribute Details
#curve ⇒ Object
Returns the value of attribute curve.
69 70 71 |
# File 'lib/ccrypto/configs/keypair_config.rb', line 69 def curve @curve end |
Class Method Details
.name ⇒ Object
65 66 67 |
# File 'lib/ccrypto/configs/keypair_config.rb', line 65 def self.name "Elliptic Curve (ECC)" end |
.supported_curves(&block) ⇒ Object
81 82 83 |
# File 'lib/ccrypto/configs/keypair_config.rb', line 81 def self.supported_curves(&block) Provider.instance.provider.algo_instance(*[ECCConfig], &block).supported_curves end |
Instance Method Details
#to_s ⇒ Object
77 78 79 |
# File 'lib/ccrypto/configs/keypair_config.rb', line 77 def to_s "#{@curve}" end |