在openssl签发证书时如何指定16字节序列号?
在使用openssl函数签发证书时遇到了点问题,项目明确要求需要指定16字节证书序列号,形如 0x4C530000000000000100020004000009,其中最后3个字节是动态变化的,在使用 openssl_csr_sign 函数时遇到了麻烦.
resource openssl_csr_sign ( mixed $csr , mixed $cacert , mixed $priv_key , int $days [, array $configargs [, int $serial=0 ]] )
最后一个参数可以指定序列号,但普通的int不能支持这么大的整数,曾经尝试过使用 sprintf('%s', $n),尝试过直接传入文本,要么只写进一个字节,要么为0
请问应该从哪个方向入手找解决办法 ?
能有示例代码更好
谢谢 !
------解决方案--------------------
Description:
------------
The Certificat defintion OpenSSL allows for numerical serial numbers up to
20 positions or more..
In PHP there is build in integer rerstriction only allowing half the serial
numbers ..... higher numbers have a cleared part......
The serial needs to be numerical no problem but it need not be an integer
or limited by that (allow higher numbers)
------解决方案--------------------
The Certificat defintion OpenSSL allows for numerical serial numbers up to
20 positions or more..
In PHP there is build in integer rerstriction only allowing half the serial
numbers ..... higher numbers have a cleared part......
貌似意思是默认openssl支持20位长度的整数,但php的内置int类型只有一半长度,高半部分被清零。
0
0
相关文章
php调用听书插件需要哪些基础环境_php调用听书插件环境准备清单【配置】
php远程访问文件怎么打开_php远程二进制文件读取法【二进制】
PHP本地环境如何配置SMTP发信_PHP本地环境配SMTP发信方法【配置】
PHP怎么设置OpenSSL支持_PHP设置OpenSSL支持编译【协议】
php调用听书插件需引入哪些核心文件_php听书插件核心文件引入法【清单】
本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门AI工具
相关专题
C++ 设计模式与软件架构
本专题深入讲解 C++ 中的常见设计模式与架构优化,包括单例模式、工厂模式、观察者模式、策略模式、命令模式等,结合实际案例展示如何在 C++ 项目中应用这些模式提升代码可维护性与扩展性。通过案例分析,帮助开发者掌握 如何运用设计模式构建高质量的软件架构,提升系统的灵活性与可扩展性。
14
2026.01.30
热门下载
相关下载
最新文章








