     err = null
     ret = null
     klass = cfg.klass or SelfCertifiedToken
-    if not (b = utils.base64u.decode(s))? or b.length is 0
+    if not (b = decode(s))? or b.length is 0
       err = "Failed to base64-decode"
     else if not ([e,x] = (utils.katch () -> unpack b))? or e?
       err = "Failed to purepack.unpack"

constants      = require './constants'
sc             = require('./status').codes
mm             = require('./mod').mgr

##=======================================================================



  _make_mac : (enc = null) ->
    msg = @_pack true
    key = decode @key
    hm = crypto.createHmac 'sha512', key
    hm.update msg
    hm.digest()
