Class: Ccrypto::RSAConfig

Inherits:
KeypairConfig show all
Defined in:
lib/ccrypto/configs/keypair_config.rb

Overview

ECCConfig

Constant Summary

Constants inherited from KeypairConfig

KeypairConfig::Algo_Active, KeypairConfig::Algo_Broken, KeypairConfig::Algo_NotRecommended, KeypairConfig::Algo_Obsolete

Instance Attribute Summary collapse

Attributes inherited from KeypairConfig

#algo, #algo_status, #default, #keypair, #private_key, #provider_config, #public_key

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from KeypairConfig

#has_keypair?, #has_private_key?, #has_public_key?, #is_default_algo?, keypair_purposes, supported_keypair_config

Methods included from AlgoConfig

include

Constructor Details

#initialize(keysize = 2048, status = Algo_Active, default = false) ⇒ RSAConfig

Returns a new instance of RSAConfig.



106
107
108
109
110
# File 'lib/ccrypto/configs/keypair_config.rb', line 106

def initialize(keysize = 2048, status = Algo_Active, default = false)
  @algo = self.class.algo_key
  @keysize = keysize
  super(status, default)
end

Instance Attribute Details

#keysizeObject (readonly)

Returns the value of attribute keysize.



105
106
107
# File 'lib/ccrypto/configs/keypair_config.rb', line 105

def keysize
  @keysize
end

Class Method Details

.algo_keyObject



101
102
103
# File 'lib/ccrypto/configs/keypair_config.rb', line 101

def self.algo_key
  :rsa
end

.algo_nameObject



97
98
99
# File 'lib/ccrypto/configs/keypair_config.rb', line 97

def self.algo_name
  "RSA (Classical - Signing and Encryption)"
end

.supported_keysizes(&block) ⇒ Object



120
121
122
# File 'lib/ccrypto/configs/keypair_config.rb', line 120

def self.supported_keysizes(&block)
  Provider.instance.provider.algo_instance(*[RSAConfig],&block).supported_keysizes
end

Instance Method Details

#paramObject



112
113
114
# File 'lib/ccrypto/configs/keypair_config.rb', line 112

def param
  @keysize
end

#to_sObject



116
117
118
# File 'lib/ccrypto/configs/keypair_config.rb', line 116

def to_s
  "RSA-#{keysize} bits"
end