Use the optional PKI_ENCODE_BASE64URL option when creating a signature with
SIG_SignData
or Sig.SignData
to output the signature value in base64url encoding suitable for inserting in a JSON Web Signature.
Base64url encoding is defined in [RFC7515] to use the URL- and filename-safe character set in section 5 of [RFC4648] with all trailing "=" characters omitted.
The base64url character set is identical to base64 except "+" (plus sign, U+002B) is replaced by "-" (hyphen-minus, U+002D), and "/" (slash, U+002F) by "_" (underscore, U+005F).
For example, the byte array represented in hexadecimal by "FEDCBAF8765432" is represented by "/ty6+HZUMg=="
in base64 and "_ty6-HZUMg"
in base64url.