Sample code for 30+ languages & platforms
PowerBuilder

Base64url Encoding

See more Encryption Examples

Base64url encoding is identical to base64 encoding except it uses non-reserved URL characters (e.g. '–' is used instead of '+', and '_' is used instead of '/') and it omits the padding characters.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
integer li_Success
oleobject loo_Pkey
oleobject loo_Rsa
string ls_StrData
string ls_StrSig

li_Success = 0

// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

loo_Pkey = create oleobject
li_rc = loo_Pkey.ConnectToNewObject("Chilkat.PrivateKey")
if li_rc < 0 then
    destroy loo_Pkey
    MessageBox("Error","Connecting to COM object failed")
    return
end if
loo_Rsa = create oleobject
li_rc = loo_Rsa.ConnectToNewObject("Chilkat.Rsa")

loo_Rsa.GenKey(1024,loo_Pkey)
loo_Rsa.UsePrivateKey(loo_Pkey)

ls_StrData = "This is the string to be signed."

// Get the signature in base64url
loo_Rsa.EncodingMode = "base64url"
ls_StrSig = loo_Rsa.SignStringENC(ls_StrData,"sha256")

Write-Debug ls_StrSig


destroy loo_Pkey
destroy loo_Rsa