We need url safe base64 encoding and openssl only gives us regular
base64, so we convert it here. Also trim trailing '=' from data
(see RFC).
The following replacements are done:
* '+' is converted to '-'
* '/' is converted to '_'
* '=' terminates the output at this point, stripping all '=' chars
Encode data as URl-safe Base64
We need url safe base64 encoding and openssl only gives us regular base64, so we convert it here. Also trim trailing '=' from data (see RFC).
The following replacements are done: * '+' is converted to '-' * '/' is converted to '_' * '=' terminates the output at this point, stripping all '=' chars