Method: SSHData::PublicKey::RSA#initialize

Defined in:
lib/ssh_data/public_key/rsa.rb

#initialize(algo:, e:, n:) ⇒ RSA

Returns a new instance of RSA.



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ssh_data/public_key/rsa.rb', line 12

def initialize(algo:, e:, n:)
  unless algo == ALGO_RSA
    raise DecodeError, "bad algorithm: #{algo.inspect}"
  end

  @algo = algo
  @e = e
  @n = n

  @openssl = OpenSSL::PKey::RSA.new(asn1.to_der)

  super(algo: algo)
end