pandexio 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11d0ae57fd72c6ad78f545813885cccb081cf150
4
- data.tar.gz: b1576bd2c258a559c6e95b699dd685ed650dbacb
3
+ metadata.gz: 93955fe9ac0c000146783acacd316db93d9a7c1c
4
+ data.tar.gz: 81e6a17fdcfc3e31e6211e0169c22f85765ad2f2
5
5
  SHA512:
6
- metadata.gz: 91fe4c64f017985f897317166cdf8793d27d548e6907c29ccd970b670a8cd591fb97cc47cc763335d627e50b7b65b03161f28ba139d59efcb369dbbf73d087cc
7
- data.tar.gz: 65cb8adb6cfa96e496d43cd5eb2af3c121cf4097e76e66f435d29ae4f4012cc00ce988fe1533a563ebc0ccb1fcb8bf7cea3e9bb75e5e0c4ef45c2a0da56f9de3
6
+ metadata.gz: b71c8853105942558299ab05bbb2e4ac2fe44216af5499f8048d67f4bd06022825d0d6969411f0b2350e3390b98cffe05a7463ebcbafb7c17309c84d21dda058
7
+ data.tar.gz: 2cb926aa6447257e3e0580bc42d2544d3a9a280a8ca553e8fef69bb0730386783bae2ce3fe56f0c6a0fde6dd12bdbb42a97fda0dd704de7e8b6600ff4f4a572f
data/lib/pandexio.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'time'
2
2
  require 'stringio'
3
- require 'digest/hmac'
3
+ require 'openssl'
4
4
  require_relative 'request.rb'
5
5
  require_relative 'signing_algorithms.rb'
6
6
  require_relative 'signing_attributes.rb'
@@ -93,7 +93,7 @@ module Pandexio
93
93
  end
94
94
 
95
95
  def self.generate_signature(string_to_sign, signing_options, digest)
96
- return Digest::HMAC.hexdigest(string_to_sign, signing_options.domain_key, digest)
96
+ return OpenSSL::HMAC.hexdigest(digest, signing_options.domain_key, string_to_sign)
97
97
  end
98
98
 
99
99
  public
@@ -22,13 +22,13 @@ module Pandexio
22
22
  def self.to_d(a)
23
23
 
24
24
  return case a
25
- when SigningAlgorithms::PDX_HMAC_MD5; Digest::MD5
26
- when SigningAlgorithms::PDX_HMAC_SHA1; Digest::SHA1
27
- when SigningAlgorithms::PDX_HMAC_SHA256; Digest::SHA256
28
- when SigningAlgorithms::PDX_HMAC_SHA384; Digest::SHA384
29
- when SigningAlgorithms::PDX_HMAC_SHA512; Digest::SHA512
30
- else raise 'Invalid signing algorithm'
31
- end
25
+ when SigningAlgorithms::PDX_HMAC_MD5; OpenSSL::Digest::MD5.new
26
+ when SigningAlgorithms::PDX_HMAC_SHA1; OpenSSL::Digest::SHA1.new
27
+ when SigningAlgorithms::PDX_HMAC_SHA256; OpenSSL::Digest::SHA256.new
28
+ when SigningAlgorithms::PDX_HMAC_SHA384; OpenSSL::Digest::SHA384.new
29
+ when SigningAlgorithms::PDX_HMAC_SHA512; OpenSSL::Digest::SHA512.new
30
+ else raise 'Invalid signing algorithm'
31
+ end
32
32
 
33
33
  end
34
34
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandexio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Varilone