Class: Ccrypto::KeypairConfig

Inherits:
Object
  • Object
show all
Includes:
AlgoConfig
Defined in:
lib/ccrypto/configs/keypair_config.rb

Direct Known Subclasses

ECCConfig, RSAConfig

Instance Attribute Summary collapse

Attributes included from AlgoConfig

#provider_config

Instance Method Summary collapse

Methods included from AlgoConfig

include, #provider_info

Instance Attribute Details

#algoObject

Returns the value of attribute algo.



7
8
9
# File 'lib/ccrypto/configs/keypair_config.rb', line 7

def algo
  @algo
end

#keypairObject

Returns the value of attribute keypair.



8
9
10
# File 'lib/ccrypto/configs/keypair_config.rb', line 8

def keypair
  @keypair
end

#private_keyObject

Returns the value of attribute private_key.



8
9
10
# File 'lib/ccrypto/configs/keypair_config.rb', line 8

def private_key
  @private_key
end

#public_keyObject

Returns the value of attribute public_key.



8
9
10
# File 'lib/ccrypto/configs/keypair_config.rb', line 8

def public_key
  @public_key
end

Instance Method Details

#has_keypair?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/ccrypto/configs/keypair_config.rb', line 10

def has_keypair?
  (not @keypair.nil?) or not (@privateKey.nil? and @publicKey.nil?)
end

#has_private_key?Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
# File 'lib/ccrypto/configs/keypair_config.rb', line 14

def has_private_key?
  if has_keypair?
    not @keypair.private_key.nil?
  else
    not @private_key.nil?
  end
end

#has_public_key?Boolean

Returns:

  • (Boolean)


22
23
24
25
26
27
28
# File 'lib/ccrypto/configs/keypair_config.rb', line 22

def has_public_key?
  if has_keypair?
    not @keypair.public_key.nil?
  else
    not @public_key.nil?
  end
end