Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base64 support #9

Open
SaadArdati opened this issue Aug 26, 2020 · 2 comments
Open

base64 support #9

SaadArdati opened this issue Aug 26, 2020 · 2 comments

Comments

@SaadArdati
Copy link

SaadArdati commented Aug 26, 2020

Hello, I'm trying to implement server-side reward-ad verification through dart.
Google's Admob has very clear documentation on how to implement this in java
https://developers.google.com/admob/android/rewarded-video-ssv#fetch_public_keys
And a github sample:

The public keys are retrieved from the url: https://www.gstatic.com/admob/reward/verifier-keys.json

The keys are in base64 and the documentation also works with it as base64.

When trying to implement it with eosdart, I'm met with the error
Invalid argument(s): Non-base58 character when creating the publicKey var

Here's my code:

      // var base64 = base64Url.decode(admobPublicKeys[keyId]);
      var publicKey = EOSPrivateKey.fromString(admobPublicKeys[keyId]).toEOSPublicKey();

      var privateKey = EOSPrivateKey.fromString(signature);
      var signer = privateKey.signString(data);

      return signer.verify(data, publicKey);

I'm not too familiar with ECC verification. So if I made any other mistakes, please tell me.
However, for the current issue at hand, the keys are in base64, while the package requires base58. I'm not sure what to do.

@redDwarf03
Copy link

hello.
any solutions ?

@fzxu
Copy link
Contributor

fzxu commented Nov 26, 2020

@redDwarf03 May I know why it is related to Google Admob? this project is for EOS crypto network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants