[php] GET 或 header 信息传递加密
来源:互联网 发布:手机qq浏览器3.1java版 编辑:程序博客网 时间:2024/04/30 05:42
php-jwt
- 使用方法:
<?phpuse \Firebase\JWT\JWT;$key = "example_key";$token = array( "iss" => "http://example.org", "aud" => "http://example.com", "iat" => 1356999524, "nbf" => 1357000000);/** * IMPORTANT: * You must specify supported algorithms for your application. See * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40 * for a list of spec-compliant algorithms. */$jwt = JWT::encode($token, $key);$decoded = JWT::decode($jwt, $key, array('HS256'));print_r($decoded);/* NOTE: This will now be an object instead of an associative array. To get an associative array, you will need to cast it as such:*/$decoded_array = (array) $decoded;/** * You can add a leeway to account for when there is a clock skew times between * the signing and verifying servers. It is recommended that this leeway should * not be bigger than a few minutes. * * Source: http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#nbfDef */JWT::$leeway = 60; // $leeway in seconds$decoded = JWT::decode($jwt, $key, array('HS256'));?>
- composer 引用
composer require firebase/php-jwt
- 源码下载
- 原文链接
0 0
- [php] GET 或 header 信息传递加密
- php header头信息 举例
- php header 常用头信息
- curl get请求添加header头信息
- php header信息收集(不断修改)
- php 获取远程网址header头信息
- PHP获取header头部信息详解
- php 文件头部(header)信息详解
- php curl 分离header和body信息
- php 有用的header 头信息
- php常用的header()头信息
- 用php获取header头信息
- 用超链接传递数组或get方式
- 用Get方式提交信息加密解密
- 通过超链接get方式传递id信息
- PHP传递checkbox的信息
- C#使用HttpWebRequest POST或GET信息
- http传递参数信息和传递方式post、get
- 《iOS开发指南:从零基础到App Store上架》读书笔记(一)
- nmon 使用
- debian8 gnome 亮度调节
- Yii2 添加国际化支持
- R-主成分-聚类-因子分析解释
- [php] GET 或 header 信息传递加密
- 【ffmpeg】linux下编译ffmpeg
- ES6、Javascript、CommonJS、AMD、nodejs的关系与差异
- Useful tools list (environment setup)
- nginx的location配置详解
- Android studio使用---WiFi ADB使用以及连接手机调试
- spring与mybatis三种整合方法
- MyEclipse2015安装与破解
- 主从复制原理