Skip to content

Commit 9ac5b3b

Browse files
authored
Merge pull request #2 from andrew-svirin/3.0.2
upd euspe
2 parents 99f4778 + 0b9fbd5 commit 9ac5b3b

File tree

6 files changed

+28
-83
lines changed

6 files changed

+28
-83
lines changed

src/Client.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ private function handleResult(string $command, $iResult, int $iErrorCode = null,
1919
{
2020
if (!empty($iErrorCode) && !in_array($iErrorCode, $aAcceptableErrorCodes)) {
2121
euspe_geterrdescr($iErrorCode, $sErrorDescription);
22+
$utfEncoding = 'utf-8';
2223
throw new Exception(
2324
sprintf(
2425
'Result: %s Code: %s Command: %s Error: %s. Check error in EUSignConsts.php by code.',
25-
dechex($iResult),
26+
dechex($iResult),
2627
dechex($iErrorCode),
2728
$command,
28-
mb_convert_encoding($sErrorDescription, 'windows-1251', 'utf-8')
29+
($encoding = mb_detect_encoding($sErrorDescription)) && strtolower($encoding) !== $utfEncoding ?
30+
mb_convert_encoding($sErrorDescription, $encoding, $utfEncoding) :
31+
$sErrorDescription
2932
)
3033
);
3134
}

src/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class User
3030
*/
3131
private $password;
3232

33-
public function __construct($userName, $serverHost, $keyType = null, $keyData = null, $password = null)
33+
public function __construct(string $userName, string $serverHost, string $keyType = null, string $keyData = null, string $password = null)
3434
{
3535
$this->userName = $userName;
3636
$this->serverHost = $serverHost;

src/servers/acsk.privatbank.ua.dist.ini

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
[\SOFTWARE\Institute of Informational Technologies\Certificate Authority-1.3\End User\FileStore]
33
ExpireTime=3600
44
SaveLoadedCerts=1
5-
AutoDownloadCRLs=0
6-
FullAndDeltaCRLs=1
7-
OnlyOwnCRLs=1
8-
AutoRefresh=0
9-
CheckCRLs=0
5+
AutoDownloadCRLs=1
6+
FullAndDeltaCRLs=0
7+
OnlyOwnCRLs=0
8+
AutoRefresh=1
9+
CheckCRLs=1
1010
Path={dir}
1111
[\SOFTWARE\Institute of Informational Technologies\Certificate Authority-1.3\End User\Proxy]
1212
SavePassword=0
@@ -43,30 +43,11 @@ Port=80
4343
Offline=0
4444
ResetPKey=0
4545
MakePKeyPFXContainer=0
46-
[\SOFTWARE\Institute of Informational Technologies\Certificate Authority-1.3\End User\Log]
47-
System=1
48-
ReportAgent=0
49-
Address=
50-
Port=10111
51-
OnlyErrors=1
5246
[\SOFTWARE\Institute of Informational Technologies\Certificate Authority-1.3\End User\Libraries\Sign]
5347
[\SOFTWARE\Institute of Informational Technologies\Certificate Authority-1.3\End User\Libraries\Sign\KeyMedia]
5448
ProtectPassword=0
5549
Password=
5650
Device=0
5751
Type=3
5852
ShowErrors=0
59-
SourceType=2
60-
[\SOFTWARE\Institute of Informational Technologies\Key Medias]
61-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\File System]
62-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\File System\Folders]
63-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\File System\Folders\{dir}]
64-
OrderNumber=0
65-
Path={dir}
66-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\NCM Gryada-301]
67-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\NCM Gryada-301\Modules]
68-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\NCM Gryada-301\Modules\001]
69-
OrderNumber=0
70-
SN=001
71-
Address=20.0.0.1
72-
AddressMask=255.0.0.0
53+
SourceType=2

src/servers/acskidd.gov.ua.dist.ini

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
[\SOFTWARE\Institute of Informational Technologies\Certificate Authority-1.3\End User\FileStore]
33
ExpireTime=3600
44
SaveLoadedCerts=1
5-
AutoDownloadCRLs=0
6-
FullAndDeltaCRLs=1
7-
OnlyOwnCRLs=1
8-
AutoRefresh=0
9-
CheckCRLs=0
5+
AutoDownloadCRLs=1
6+
FullAndDeltaCRLs=0
7+
OnlyOwnCRLs=0
8+
AutoRefresh=1
9+
CheckCRLs=1
1010
Path={dir}
1111
[\SOFTWARE\Institute of Informational Technologies\Certificate Authority-1.3\End User\Proxy]
1212
SavePassword=0
@@ -56,17 +56,4 @@ Password=
5656
Device=0
5757
Type=3
5858
ShowErrors=0
59-
SourceType=2
60-
[\SOFTWARE\Institute of Informational Technologies\Key Medias]
61-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\File System]
62-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\File System\Folders]
63-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\File System\Folders\{dir}]
64-
OrderNumber=0
65-
Path={dir}
66-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\NCM Gryada-301]
67-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\NCM Gryada-301\Modules]
68-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\NCM Gryada-301\Modules\001]
69-
OrderNumber=0
70-
SN=001
71-
Address=20.0.0.1
72-
AddressMask=255.0.0.0
59+
SourceType=2

src/servers/ca.iit.com.ua.dist.ini

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
[\SOFTWARE\Institute of Informational Technologies\Certificate Authority-1.3\End User\FileStore]
33
ExpireTime=3600
44
SaveLoadedCerts=1
5-
AutoDownloadCRLs=0
6-
FullAndDeltaCRLs=1
7-
OnlyOwnCRLs=1
8-
AutoRefresh=0
9-
CheckCRLs=0
5+
AutoDownloadCRLs=1
6+
FullAndDeltaCRLs=0
7+
OnlyOwnCRLs=0
8+
AutoRefresh=1
9+
CheckCRLs=1
1010
Path={dir}
1111
[\SOFTWARE\Institute of Informational Technologies\Certificate Authority-1.3\End User\Proxy]
1212
SavePassword=0
@@ -57,16 +57,3 @@ Device=0
5757
Type=3
5858
ShowErrors=0
5959
SourceType=2
60-
[\SOFTWARE\Institute of Informational Technologies\Key Medias]
61-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\File System]
62-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\File System\Folders]
63-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\File System\Folders\{dir}]
64-
OrderNumber=0
65-
Path={dir}
66-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\NCM Gryada-301]
67-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\NCM Gryada-301\Modules]
68-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\NCM Gryada-301\Modules\001]
69-
OrderNumber=0
70-
SN=001
71-
Address=20.0.0.1
72-
AddressMask=255.0.0.0

src/servers/ca.ksystems.com.ua.dist.ini

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
[\SOFTWARE\Institute of Informational Technologies\Certificate Authority-1.3\End User\FileStore]
33
ExpireTime=3600
44
SaveLoadedCerts=1
5-
AutoDownloadCRLs=0
6-
FullAndDeltaCRLs=1
7-
OnlyOwnCRLs=1
8-
AutoRefresh=0
9-
CheckCRLs=0
5+
AutoDownloadCRLs=1
6+
FullAndDeltaCRLs=0
7+
OnlyOwnCRLs=0
8+
AutoRefresh=1
9+
CheckCRLs=1
1010
Path={dir}
1111
[\SOFTWARE\Institute of Informational Technologies\Certificate Authority-1.3\End User\Proxy]
1212
SavePassword=0
@@ -57,16 +57,3 @@ Device=0
5757
Type=3
5858
ShowErrors=0
5959
SourceType=2
60-
[\SOFTWARE\Institute of Informational Technologies\Key Medias]
61-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\File System]
62-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\File System\Folders]
63-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\File System\Folders\{dir}]
64-
OrderNumber=0
65-
Path={dir}
66-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\NCM Gryada-301]
67-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\NCM Gryada-301\Modules]
68-
[\SOFTWARE\Institute of Informational Technologies\Key Medias\NCM Gryada-301\Modules\001]
69-
OrderNumber=0
70-
SN=001
71-
Address=20.0.0.1
72-
AddressMask=255.0.0.0

0 commit comments

Comments
 (0)