Sha256: c3130ccedc7ee52329a7027378021bf87127fb91840c058edd8e703bab98f37d
Contents?: true
Size: 653 Bytes
Versions: 9
Compression:
Stored size: 653 Bytes
Contents
require 'test_helper' class Alipay::Sign::RSATest < Minitest::Test def setup @string = "partner=123&service=test" @sign = "TaVXdP/0ia5NxIv9T76v6vGOrtgoaFrwnchKIWP9PQeX1UkUVxaq6ejDFmXFrFR+Plk+E/XzfV2DYJSVt0Am0qJRSgeg+PuvK+yWGCGm9GJgUJlS4Eyta3g+8DWwRWTjUyh5yzlf9JoSnbNjYpBolnMRD7B/u1JLkTMJuMx2TVM=" end def test_sign assert_equal @sign, Alipay::Sign::RSA.sign(TEST_RSA_PRIVATE_KEY, @string) end def test_verify assert Alipay::Sign::RSA.verify?(TEST_RSA_PUBLIC_KEY, @string, @sign) end def test_verify_fail_when_sign_not_true assert !Alipay::Sign::RSA.verify?(TEST_RSA_PUBLIC_KEY, "danger#{@string}", @sign) end end
Version data entries
9 entries across 9 versions & 2 rubygems