當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Google_Utils::urlSafeB64Encode方法代碼示例

本文整理匯總了PHP中Google_Utils::urlSafeB64Encode方法的典型用法代碼示例。如果您正苦於以下問題:PHP Google_Utils::urlSafeB64Encode方法的具體用法?PHP Google_Utils::urlSafeB64Encode怎麽用?PHP Google_Utils::urlSafeB64Encode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Google_Utils的用法示例。


在下文中一共展示了Google_Utils::urlSafeB64Encode方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: makeSignedJwt

 /**
  * Creates a signed JWT.
  * @param array $payload
  * @return string The signed JWT.
  */
 private function makeSignedJwt($payload)
 {
     $header = array('typ' => 'JWT', 'alg' => 'RS256');
     $segments = array(Google_Utils::urlSafeB64Encode(json_encode($header)), Google_Utils::urlSafeB64Encode(json_encode($payload)));
     $signingInput = implode('.', $segments);
     $signer = new Google_P12Signer($this->privateKey, $this->privateKeyPassword);
     $signature = $signer->sign($signingInput);
     $segments[] = Google_Utils::urlSafeB64Encode($signature);
     return implode(".", $segments);
 }
開發者ID:omusico,項目名稱:isle-web-framework,代碼行數:15,代碼來源:Google_AssertionCredentials.php

示例2: makeSignedJwt

 private function makeSignedJwt($payload)
 {
     $header = array("typ" => "JWT", "alg" => "RS256");
     $segments = array();
     $segments[] = Google_Utils::urlSafeB64Encode(json_encode($header));
     $segments[] = Google_Utils::urlSafeB64Encode(json_encode($payload));
     $signing_input = implode(".", $segments);
     $signature = $this->signer->sign($signing_input);
     $segments[] = Google_Utils::urlSafeB64Encode($signature);
     return implode(".", $segments);
 }
開發者ID:ankush1990,項目名稱:google-api-php-client,代碼行數:11,代碼來源:AuthTest.php

示例3: makeSignedJwt

 /**
  * Creates a signed JWT.
  * @param array $payload
  * @return string The signed JWT.
  */
 private function makeSignedJwt($payload)
 {
     $header = array('typ' => 'JWT', 'alg' => 'RS256');
     $payload = json_encode($payload);
     // Handle some overzealous escaping in PHP json that seemed to cause some errors
     // with claimsets.
     $payload = str_replace('\\/', '/', $payload);
     $segments = array(Google_Utils::urlSafeB64Encode(json_encode($header)), Google_Utils::urlSafeB64Encode($payload));
     $signingInput = implode('.', $segments);
     $signer = new Google_Signer_P12($this->privateKey, $this->privateKeyPassword);
     $signature = $signer->sign($signingInput);
     $segments[] = Google_Utils::urlSafeB64Encode($signature);
     return implode(".", $segments);
 }
開發者ID:Gerhard13,項目名稱:pimcore,代碼行數:19,代碼來源:AssertionCredentials.php

示例4: uploadAccount

 /**
  * Invokes the UploadAccount API.
  *
  * @param string $hashAlgorithm password hash algorithm. See Gitkit doc for
  *                              supported names.
  * @param string $hashKey raw key for the algorithm
  * @param array $accounts array of account info to be uploaded
  * @param null|int $rounds Rounds of the hash function
  * @param null|int $memoryCost Memory cost of the hash function
  */
 public function uploadAccount($hashAlgorithm, $hashKey, $accounts, $rounds, $memoryCost)
 {
     $data = array('hashAlgorithm' => $hashAlgorithm, 'signerKey' => Google_Utils::urlSafeB64Encode($hashKey), 'users' => $accounts);
     if ($rounds) {
         $data['rounds'] = $rounds;
     }
     if ($memoryCost) {
         $data['memoryCost'] = $memoryCost;
     }
     $this->invokeGitkitApiWithServiceAccount('uploadAccount', $data);
 }
開發者ID:redstrike,項目名稱:identity-toolkit-php-client,代碼行數:21,代碼來源:RpcHelper.php

示例5: toJsonRequest

 /**
  * Converts Gitkit account array to json request.
  *
  * @param array $accounts Gitkit account array
  * @return array json request
  */
 private function toJsonRequest($accounts)
 {
     $jsonUsers = array();
     foreach ($accounts as $account) {
         $user = array('email' => $account->getEmail(), 'localId' => $account->getUserId(), 'passwordHash' => Google_Utils::urlSafeB64Encode($account->getPasswordHash()), 'salt' => Google_Utils::urlSafeB64Encode($account->getSalt()));
         array_push($jsonUsers, $user);
     }
     return $jsonUsers;
 }
開發者ID:00firestar00,項目名稱:identity-toolkit-php-client,代碼行數:15,代碼來源:GitkitClient.php

示例6: uploadAccount

 /**
  * Invokes the UploadAccount API.
  *
  * @param string $hashAlgorithm password hash algorithm. See Gitkit doc for
  *                              supported names.
  * @param string $hashKey raw key for the algorithm
  * @param array $accounts array of account info to be uploaded
  */
 public function uploadAccount($hashAlgorithm, $hashKey, $accounts)
 {
     $data = array('hashAlgorithm' => $hashAlgorithm, 'signerKey' => Google_Utils::urlSafeB64Encode($hashKey), 'users' => $accounts);
     $this->invokeGitkitApiWithServiceAccount('uploadAccount', $data);
 }
開發者ID:spark942,項目名稱:supinternet-projects,代碼行數:13,代碼來源:RpcHelper.php

示例7: makeSignedJwt

 public function makeSignedJwt($payload, $cred)
 {
     $header = array("typ" => "JWT", "alg" => "RS256");
     $segments = array();
     $segments[] = Google_Utils::urlSafeB64Encode(json_encode($header));
     $segments[] = Google_Utils::urlSafeB64Encode(json_encode($payload));
     $signing_input = implode(".", $segments);
     $signer = new Google_Signer_P12($cred->privateKey, $cred->privateKeyPassword);
     $signature = $signer->sign($signing_input);
     $segments[] = Google_Utils::urlSafeB64Encode($signature);
     return implode(".", $segments);
 }
開發者ID:usman-khalid,項目名稱:s2ap-quickstart-php,代碼行數:12,代碼來源:wob_utils.php


注:本文中的Google_Utils::urlSafeB64Encode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。