You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

RSA encryption from custom script

Accepted answer
edited Oct 20, 2017 9:50PM in General Technical Discussions 2 comments


We have a need for a custom script to interact with one of our APIs.  As part of this, we have to pass a JSON Web Token (JWT) to the API, and the JWT needs to be signed with RS256 (RSA Signature with SHA-256) using a private key provided to us.

Since the Crypto API in Connect PHP doesn't support this natively and we can't use PHP's openssl functions, I've tried utilizing the phpseclib third-party library for this.  Unfortunately, none of the PHP extensions the library uses for computation are available and it looks like it's falling back on the slowest, PHP-only method for performing the encryption, which means that it's taking 20-30 seconds each request to sign the token.  This is meant to replace a current process that agents are using while on the phone, so they can't be waiting around and adding 30 seconds to each call's handle time.

Howdy, Stranger!

Log In

To view full details, sign in.


Don't have an account? Click here to get started!