Class: OmniAuth::Strategies::Latvija::Decryptor

Inherits:
Object
  • Object
show all
Defined in:
lib/omniauth/strategies/latvija/decryptor.rb

Instance Method Summary collapse

Constructor Details

#initialize(response, key) ⇒ Decryptor

Returns a new instance of Decryptor.


4
5
6
7
# File 'lib/omniauth/strategies/latvija/decryptor.rb', line 4

def initialize(response, key)
  @response = response
  @key = key
end

Instance Method Details

#decryptObject


9
10
11
12
13
# File 'lib/omniauth/strategies/latvija/decryptor.rb', line 9

def decrypt
  private_key = OpenSSL::PKey::RSA.new(@key)
  encrypted_document = Xmlenc::EncryptedDocument.new(@response)
  encrypted_document.decrypt(private_key)
end