Giter VIP home page Giter VIP logo

applepayandroidpaydecryption's People

Contributors

chengbo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

applepayandroidpaydecryption's Issues

Apple Pay JS

Hi Cheng,

I am using Apple pay JS to integrate Apple pay on my website and NOT app. I have managed to get the merchant validated and on session.onpaymentauthorized event i am receiving the payment token

`session.onpaymentauthorized = function (event) {

            // Get the payment data for use to capture funds from
            // the encrypted Apple Pay token in your server.
            var token = event.payment.token.paymentData;`

Can you please explain how i can decrypt the token using your code? I see that you have test method as below:

`public void InitCompatibleTest()
        {
            var decrypter = new ApplePayTokenDecrypter();
            var p = new ApplePayParameters
            {
                //EphemeralPublicKey = "dGVzdA==",
                EphemeralPublicKey = "",
                PrivateKey = "dGVzdA=="
            };
            decrypter.Init(p);

            Assert.AreSame(p, decrypter.PaymentParameters);
        }`

ApplePay解密问题

我按照你的方式,打开证书文件,得到的如下面所示
qq 20170622140540
我拿到的加密信息时这样的,如下图所示
33
我用你的代码测试的时候,到下面这里过不去,是我哪里没用对吗?
44

System.NullReferenceException PrivateKeyFactory

Hi Cheng.

            var p = new ApplePayParameters
            {
                PrivateKey = "MIIEvQIBADANBgkqhkiG9w........=",
                EphemeralPublicKey = "MFkwEwYHKoZI.......==",
                MerchantIdentifier = "me...."
            };
            ApplePayTokenDecrypter d = new ApplePayTokenDecrypter();
            d.Init(p);
           var res = d.Decrypt("Q8JclPEJp....ZGYl","");

The Decryption method throws an exception on the call
PrivateKeyParameters = CreatePrivateKeyParameters ();
In the line
Return (ECPrivateKeyParameters) PrivateKeyFactory.CreateKey (privInfo);
Because of what this can be?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.