RSA encryption from custom script
Content
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.