Socket
Book a DemoInstallSign in
Socket

gmobile-voice-otp

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gmobile-voice-otp

Gmobile voice otp library

0.1.2
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Send Gmobile OTP

Basic use

const client = new GmobileVoiceOTPClient(baseURL, privateKey, publicKey, userCode);

// random id
const transId = v4();
const res = await client.createVoiceOTP({
    callee: '0987654321',
    otp: '123456',
    transId,
});

Generate signature and verify

const client = new GmobileVoiceOTPClient(baseURL, privateKey, publicKey, userCode);

const input = 'callee=0975096810&trans_id=235123511261236&otp=123456'
const signature = client.createSignature(input);

const verify = client.verifySignature(input, signature); // return true/false

How to create private key

ssh-keygen -b 2048 -m PEM -N '' -f ./key

then convert public key key.pub to PKCS8 format

ssh-keygen -f key.pub -e -m PKCS8 > ./key.pubx

provide generated public key to Gmobile

Features

  • Generate signature
  • Verify signature
  • Send Voice OTP
  • Get detail of task

And coming up

  • Get balance
  • Verify callback api

Development and testing

cp test/sandbox.tmp.ts test/sandbox.ts

Update private key, public key, then run commands to test

npm run test

Keywords

gmobile

FAQs

Package last updated on 18 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.