vakata / certificate
解析来自所有保加利亚供应商的数字证书
5.14.2
2023-02-15 09:42 UTC
Requires
- php: >=7.0
- vakata/asn1: ^2.1.0
Requires (Dev)
- clean/phpdoc-md: dev-master
- codeclimate/php-test-reporter: dev-master
- phpunit/phpunit: 4.*
- dev-master
- 5.14.2
- 5.14.1
- 5.14.0
- 5.13.2
- 5.13.1
- 5.13.0
- 5.12.1
- 5.12.0
- 5.11.3
- 5.11.2
- 5.11.1
- 5.11.0
- 5.10.0
- 5.9.0
- 5.8.0
- 5.7.0
- 5.6.2
- 5.6.1
- 5.6.0
- 5.5.2
- 5.5.1
- 5.5.0
- 5.4.0
- 5.3.2
- 5.3.1
- 5.3.0
- 5.2.2
- 5.2.1
- 5.2.0
- 5.1.0
- 5.0.1
- 5.0.0
- 4.1.0
- 4.0.1
- 4.0.0
- 3.0.0
- 2.6.0
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.1
- 2.4.0
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.0
- 1.1.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-09-15 13:06:04 UTC
README
解析来自所有保加利亚供应商的数字证书(以及与欧盟通用标准兼容的所有其他供应商)。
安装
通过 Composer
$ composer require vakata/certificate
使用方法
// parse the certificate from the current request ($_SERVER['SSL_CLIENT_CERT']) // on Apache this will work if SSLOptions +ExportCertData is set $cert = \vakata\certificate\Certificate::fromRequest(); // you can then get various information from the certificate echo $cert->getNaturalPerson()->getID(); // EGN or PID if ($cert->isProfessional()) { echo $cert->getLegalPerson()->getBulstat(); // BULSTAT } // you can also create an instance from a x509 string $certStr = new \vakata\certificate\Certificate("x509 formatted string"); // or using a static method $certStr = new \vakata\certificate\Certificate::fromString("x509 formatted string"); // or from a file $certFile = \vakata\certificate\Certificate::fromFile("/path/to/file.crt");
证书也可以进行验证(通过检查过期日期、CRLs以及验证证书签名)。请注意,签名验证是通过 OpenSSL PHP 扩展实现的。
在API 文档中了解更多
测试
$ composer test
贡献
有关详细信息,请参阅CONTRIBUTING
安全
如果您发现任何与安全相关的问题,请通过电子邮件github@vakata.com报告,而不是使用问题跟踪器。
鸣谢
许可证
MIT 许可证(MIT)。有关更多信息,请参阅许可证文件