Class: RSA::Public

Inherits:
Object
  • Object
show all
Defined in:
lib/rsa.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(private:) ⇒ Public

Returns a new instance of Public.



101
102
103
104
105
# File 'lib/rsa.rb', line 101

def initialize(private:)
  generated(private)
  choice_e(private)
  private.generated_d(@e)
end

Instance Attribute Details

#eObject (readonly)

Returns the value of attribute e.



99
100
101
# File 'lib/rsa.rb', line 99

def e
  @e
end

#key_nObject (readonly)

Returns the value of attribute key_n.



99
100
101
# File 'lib/rsa.rb', line 99

def key_n
  @key_n
end

Instance Method Details

#create_file(archive) ⇒ Object



112
113
114
# File 'lib/rsa.rb', line 112

def create_file(archive)
  archive.write [@key_n, @e]
end

#create_file_of_keysObject



107
108
109
110
# File 'lib/rsa.rb', line 107

def create_file_of_keys
  public_key_file = ArchivePublic.new
  public_key_file.write keys
end