/** * return JWT Signing Input * * @return string Signing Input String */ public function generateSigningInput() { $token = Akita_JOSE_Base64::urlEncode(Akita_JOSE_Json::encode($this->_header)) . "."; if (is_array($this->_payload)) { $token .= Akita_JOSE_Base64::urlEncode(Akita_JOSE_Json::encode($this->_payload)); } else { $token .= Akita_JOSE_Base64::urlEncode($this->_payload); } return $token; }
public function testUrlEncode() { $str = "1"; $enc_str = "MQ"; $enc = Akita_JOSE_Base64::urlEncode($str); $this->assertEquals($enc_str, $enc); $str = "1234"; $enc_str = "MTIzNA"; $enc = Akita_JOSE_base64::urlEncode($str); $this->assertequals($enc_str, $enc); $str = "ABCDEFG"; $enc_str = "QUJDREVGRw"; $enc = Akita_JOSE_base64::urlEncode($str); $this->assertequals($enc_str, $enc); }