在使用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请问应该从哪个方向入手找解决办法 ?能有示例代码更好谢谢 !
------------
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)
3ks for 你的reply
e文水平not非常high,不是非常understand what u post是不是大概这个意思
php不支持超过10个字符长的数字,超过部分将被截断 ?
后面又说了啥限制
真的有点迷糊了
拜托点解一下 3q all
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类型只有一半长度,高半部分被清零。
最后一句说不是int也没问题,不知是不是这样你得改改数据测试一下,先确定能否放入这么长的值支持的类型