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 +4 -4
- data/lib/pandexio.rb +2 -2
- data/lib/signing_algorithms.rb +7 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93955fe9ac0c000146783acacd316db93d9a7c1c
|
4
|
+
data.tar.gz: 81e6a17fdcfc3e31e6211e0169c22f85765ad2f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 '
|
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
|
96
|
+
return OpenSSL::HMAC.hexdigest(digest, signing_options.domain_key, string_to_sign)
|
97
97
|
end
|
98
98
|
|
99
99
|
public
|
data/lib/signing_algorithms.rb
CHANGED
@@ -22,13 +22,13 @@ module Pandexio
|
|
22
22
|
def self.to_d(a)
|
23
23
|
|
24
24
|
return case a
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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
|
|