lib/xml/kit/decryption.rb in xml-kit-0.4.0 vs lib/xml/kit/decryption.rb in xml-kit-0.5.0
- old
+ new
@@ -54,15 +54,13 @@
private
def symmetric_key_from(encrypted_key, attempts = private_keys.count)
cipher, algorithm = cipher_and_algorithm_from(encrypted_key)
private_keys.each do |private_key|
- begin
- attempts -= 1
- return to_plaintext(cipher, private_key, algorithm)
- rescue OpenSSL::PKey::RSAError
- raise if attempts.zero?
- end
+ attempts -= 1
+ return to_plaintext(cipher, private_key, algorithm)
+ rescue OpenSSL::PKey::RSAError
+ raise if attempts.zero?
end
raise DecryptionError, private_keys
end
def to_plaintext(cipher_text, private_key, algorithm)