當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。