当前位置: 首页>>代码示例>>PHP>>正文


PHP Encrypter::decrypt方法代码示例

本文整理汇总了PHP中Illuminate\Encryption\Encrypter::decrypt方法的典型用法代码示例。如果您正苦于以下问题:PHP Encrypter::decrypt方法的具体用法?PHP Encrypter::decrypt怎么用?PHP Encrypter::decrypt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Encryption\Encrypter的用法示例。


在下文中一共展示了Encrypter::decrypt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: restore

 /**
  * Restore the value.
  *
  * @param $value
  * @return string
  */
 public function restore($value)
 {
     if (array_get($this->fieldType->getConfig(), 'auto_decrypt') === true) {
         return $this->encrypter->decrypt($value);
     }
     return $value;
 }
开发者ID:visualturk,项目名称:encrypted-field_type,代码行数:13,代码来源:EncryptedFieldTypeModifier.php

示例2: decrypted

 /**
  * Decrypt the value.
  *
  * @return string
  */
 public function decrypted()
 {
     if (!($value = $this->object->getValue())) {
         return null;
     }
     return $this->encrypter->decrypt($value);
 }
开发者ID:AkibaTech,项目名称:encrypted-field_type,代码行数:12,代码来源:EncryptedFieldTypePresenter.php

示例3: decrypt

 /**
  * Decrypt the given cookie value.
  *
  * @param  string      $value
  * @return mixed|null
  */
 protected function decrypt($value)
 {
     try {
         return $this->encrypter->decrypt($value);
     } catch (\Exception $e) {
         return null;
     }
 }
开发者ID:defra91,项目名称:levecchiecredenze.it,代码行数:14,代码来源:CookieJar.php

示例4: decrypt

 /**
  * Decrypt the cookies on the request.
  *
  * @param  \Symfony\Component\HttpFoundation\Request  $request
  * @return \Symfony\Component\HttpFoundation\Request
  */
 protected function decrypt(Request $request)
 {
     foreach ($request->cookies as $key => $c) {
         try {
             $request->cookies->set($key, $this->encrypter->decrypt($c));
         } catch (DecryptException $e) {
             $request->cookies->set($key, null);
         }
     }
     return $request;
 }
开发者ID:yashb,项目名称:generator,代码行数:17,代码来源:Guard.php

示例5: decrypted

 /**
  * Decrypt the value.
  *
  * @return string
  */
 public function decrypted()
 {
     if (!($value = $this->object->getValue())) {
         return null;
     }
     // Return the value if it's already decoded.
     if (array_get($this->object->getConfig(), 'auto_decrypt') === true) {
         return $value;
     }
     return $this->encrypter->decrypt($value);
 }
开发者ID:visualturk,项目名称:encrypted-field_type,代码行数:16,代码来源:EncryptedFieldTypePresenter.php

示例6: get

 /**
  * Retrieve an item from the cache by key.
  *
  * @param  string  $key
  * @return mixed
  */
 public function get($key)
 {
     $key = $this->prefix . $key;
     $cache = $this->getCacheCollection()->where('key', $key)->first();
     // If we have a cache record we will check the expiration time against current
     // time on the system and see if the record has expired. If it has, we will
     // remove the records from the database collection so it isn't returned again.
     if (!is_null($cache)) {
         if (time() >= $cache['expiration']->sec) {
             return $this->forget($key);
         }
         return $this->encrypter->decrypt($cache['value']);
     }
 }
开发者ID:vansteen,项目名称:laravel-mongodb-cache,代码行数:20,代码来源:MongodbStore.php

示例7: deserializeToken

 /**
  * Deserializes token.
  *
  * @param string $payload
  * @return AuthToken|null
  */
 public function deserializeToken($payload)
 {
     try {
         $data = $this->encrypter->decrypt($payload);
     } catch (DecryptException $e) {
         return null;
     }
     if (empty($data['id']) || empty($data['key'])) {
         return null;
     }
     $token = $this->generateAuthToken($data['key']);
     $token->setAuthIdentifier($data['id']);
     return $token;
 }
开发者ID:bytesflipper,项目名称:laravel-auth-token,代码行数:20,代码来源:AbstractAuthTokenProvider.php

示例8: deserializeToken

 /**
  * Deserializes token.
  *
  * @param string $payload
  * @return AuthToken|null
  */
 public function deserializeToken($payload)
 {
     try {
         $payload = str_replace(array('-', '_'), array('+', '/'), $payload);
         $data = $this->encrypter->decrypt($payload);
     } catch (DecryptException $e) {
         return null;
     }
     if (empty($data['id']) || empty($data['key']) || empty($data['userAgent'])) {
         return null;
     }
     $token = $this->generateAuthToken($data['key']);
     $token->setAuthIdentifier($data['id']);
     $token->setUserAgent($data['userAgent']);
     return $token;
 }
开发者ID:tfleet,项目名称:tf-auth-token,代码行数:22,代码来源:AbstractAuthTokenProvider.php

示例9: readCallback

 public static function readCallback($payload)
 {
     $crypt = new Encrypter(base64_decode(Config::get('services.etupay.key')), 'AES-256-CBC');
     $payload = json_decode($crypt->decrypt($payload));
     if ($payload && is_numeric($payload->service_data)) {
         $paymentId = $payload->service_data;
         $payment = Payment::findOrFail($paymentId);
         switch ($payload->step) {
             case 'INITIALISED':
                 $payment->state = 'returned';
                 break;
             case 'PAID':
             case 'AUTHORISATION':
                 $payment->state = 'paid';
                 break;
             case 'REFUSED':
             case 'CANCELED':
                 $payment->state = 'refused';
                 break;
             case 'REFUNDED':
                 $payment->state = 'refunded';
                 break;
         }
         $payment->informations = ['transaction_id' => $payload->transaction_id];
         $payment->save();
         if ($payment->newcomer) {
             $payment->newcomer->updateWei();
         } elseif ($payment->student) {
             $payment->student->updateWei();
         }
         return $payment;
     }
     return null;
 }
开发者ID:ungdev,项目名称:integration-UTT,代码行数:34,代码来源:EtuPay.php

示例10: get

 /**
  * Retrieve an item from the cache by key.
  *
  * @param  string  $key
  * @return mixed
  */
 public function get($key)
 {
     $prefixed = $this->prefix . $key;
     $cache = $this->table()->where('key', '=', $prefixed)->first();
     // If we have a cache record we will check the expiration time against current
     // time on the system and see if the record has expired. If it has, we will
     // remove the records from the database table so it isn't returned again.
     if (!is_null($cache)) {
         if (is_array($cache)) {
             $cache = (object) $cache;
         }
         if (time() >= $cache->expiration) {
             return $this->forget($key);
         }
         return $this->encrypter->decrypt($cache->value);
     }
 }
开发者ID:Thomvh,项目名称:turbine,代码行数:23,代码来源:DatabaseStore.php

示例11: decryptArray

 /**
  * Decrypt an array based cookie.
  *
  * @param  array  $cookie
  * @return array
  */
 protected function decryptArray(array $cookie)
 {
     $decrypted = array();
     foreach ($cookie as $key => $value) {
         $decrypted[$key] = $this->encrypter->decrypt($value);
     }
     return $decrypted;
 }
开发者ID:GeorgeBroadley,项目名称:caffeine-vendor,代码行数:14,代码来源:Guard.php

示例12: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Auth\UserInterface  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(UserInterface $user, array $credentials)
 {
     $plain = $credentials['password'];
     if ($this->encryptedPassword) {
         return $plain == $this->encrypter->decrypt($user->getAuthPassword());
     }
     return $this->hasher->check($plain, $user->getAuthPassword());
 }
开发者ID:sahilsarpal15,项目名称:mongo,代码行数:15,代码来源:MongoUserProvider.php

示例13: marshalPushedJob

 /**
  * Marshal out the pushed job and payload.
  *
  * @throws \Exception
  * @return object
  */
 protected function marshalPushedJob()
 {
     $id = $this->request->header('x-zend-job-id');
     $payload = $this->request->input("payload");
     if (empty($payload)) {
         throw new \Exception("Payload Not Found.");
     }
     $body = $this->crypt->decrypt($payload);
     return (object) ['id' => $id, 'body' => $body, 'pushed' => true];
 }
开发者ID:orlissenberg,项目名称:laravel-zendserver-pushqueue,代码行数:16,代码来源:ZendJobQueue.php

示例14: decrypt

 /**
  * Descriptografa os dados.
  *
  * @param  array $data
  * @return array
  */
 public function decrypt(array $data)
 {
     if (!isset($data['secret'])) {
         return $data;
     }
     $key = md5($data['secret'] . '-' . Config::get('app.key'));
     $cipher = Config::get('app.cipher');
     $encrypter = new Encrypter($key, $cipher);
     foreach ($data as $key => $value) {
         if (!empty($value) and in_array($key, $this->getEncryptable())) {
             $data[$key] = $encrypter->decrypt($value);
         }
     }
     return $data;
 }
开发者ID:resultsystems,项目名称:protectall,代码行数:21,代码来源:BaseCryptRepository.php

示例15: marshalPushedJob

 /**
  * Marshal out the pushed job and payload.
  *
  * @return StdClass
  */
 protected function marshalPushedJob()
 {
     $r = $this->request;
     $body = $this->crypt->decrypt($r->getContent());
     return (object) array('id' => $r->header('iron-message-id'), 'body' => $body, 'pushed' => true);
 }
开发者ID:trangunghoa,项目名称:l4cms,代码行数:11,代码来源:IronQueue.php


注:本文中的Illuminate\Encryption\Encrypter::decrypt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。