当前位置: 首页>>代码示例>>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;未经允许,请勿转载。