Module: Rmega::Crypto::Rsa

Extended by:
Rsa
Included in:
Rsa
Defined in:
lib/rmega/crypto/rsa.rb

Instance Method Summary collapse

Instance Method Details

#contextObject



12
13
14
# File 'lib/rmega/crypto/rsa.rb', line 12

def context
  @context ||= ExecJS.compile File.read(script_path)
end

#decrypt(t, privk) ⇒ Object



16
17
18
# File 'lib/rmega/crypto/rsa.rb', line 16

def decrypt(t, privk)
  context.call "RSAdecrypt", t, privk[2], privk[0], privk[1], privk[3]
end

#script_pathObject



8
9
10
# File 'lib/rmega/crypto/rsa.rb', line 8

def script_path
  File.join File.dirname(__FILE__), 'rsa_mega.js'
end