bigbank / digidoc
用于与爱沙尼亚国家身份识别平台(DigiDocService)交互的库
0.3.1
2016-09-01 11:29 UTC
Requires
- php: >=5.6
- ext-curl: *
- ext-mbstring: *
- ext-openssl: *
- ext-soap: *
- ext-xml: *
- ircmaxell/random-lib: ~1.1
- league/container: ~2.0
Requires (Dev)
This package is not auto-updated.
Last update: 2024-09-14 18:47:38 UTC
README
这是一个PHP库,用于与认证中心的DigiDocService API进行通信。该API基于SOAP,文档可在此处找到。
安装
通过Composer
$ composer require bigbank/digidoc
该库需要PHP >=5.6
,curl
,soap
,xml
,mbstring
和openssl
扩展。
用法
// Instantiate the main class $digiDoc = new DigiDoc(DigiDoc::URL_TEST); // Ask for a service (see: Services) /** @var AuthenticatorInterface $authenticator */ $authenticator = $digiDoc->getService(AuthenticatorInterface::class); // Start mobile ID authentication $userDetails = $authenticator->authenticate('14212128025', '+37200007', 'Testimine', 'My Test App', false); // Wait for the user to complete the process $authenticator->waitForAuthentication(function ($authResult) { return $authResult === 'USER_AUTHENTICATED' ? 'welcome!' : 'not authenticated'; });
更详细的用法示例可在示例目录中找到。
要使用HTTP代理,请设置HTTP_PROXY
环境变量。
服务
该库提供以下服务的访问权限
使用移动ID进行身份验证
使用用户的移动ID进行用户身份验证。
- 接口名称:
AuthenticatorInterface
- DigiDocService:
7. 身份验证的查询和响应 / 7.1 MobileAuthenticate
用法
请参阅示例。
使用移动ID进行数字签名
允许用户使用移动ID对文件进行数字签名。
- 接口名称:
FileSignerInterface
- DigiDocService:
8. 数字签名的查询和响应
用法
请参阅示例。
变更日志
请参阅CHANGELOG以获取更多最近更改的信息。
测试
$ composer test
已知问题
- 对于身份验证查询,未执行挑战验证(请参阅
Challenge
和SPChallenge
参数的MobileAuthenticate
查询)。这将在未来的版本中实施。
贡献
请参阅CONTRIBUTING和CONDUCT以获取详细信息。
安全性
如果您发现任何与安全相关的问题,请通过电子邮件:author_email联系,而不是使用问题跟踪器。
鸣谢
许可协议
Apache 2许可协议。请参阅许可文件以获取更多信息。