Skip to content

Commit e71290e

Browse files
authored
Merge pull request #3 from denpavl/update-docs-and-libs
Update docs, add libs (PHP 7.3/7.4)
2 parents 52d9c1b + c95620a commit e71290e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+97
-0
lines changed
Binary file not shown.
Binary file not shown.
2.64 MB
Binary file not shown.
2.64 MB
Binary file not shown.
2.65 MB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

docs/EUSPHPE/Usage/EUSign(5.4-7.x).php

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,40 @@ function bool_to_string($val) {
582582

583583
//----------------------------------------------------------------------------------------
584584

585+
/* Sign file internal */
586+
587+
$bExternal = false;
588+
589+
$iResult = euspe_signfile(
590+
$sFileWithData, $sFileWithSigData, $bExternal, $iErrorCode);
591+
if (!handle_result("SignFile (internal)", $iResult, $iErrorCode))
592+
Exit;
593+
594+
print_result('Signed file', $sFileWithSigData);
595+
596+
$iResult = euspe_verifyfile(
597+
$sFileWithSigData, $sFileWithVerData,
598+
$sSignTime, $bIsTSPUse,
599+
$spIssuer, $spIssuerCN, $spSerial,
600+
$spSubject, $spSubjCN,
601+
$spSubjOrg, $spSubjOrgUnit,
602+
$spSubjTitle, $spSubjState,
603+
$spSubjLocality, $spSubjFullName,
604+
$spSubjAddress, $spSubjPhone,
605+
$spSubjEMail, $spSubjDNS,
606+
$spSubjEDRPOUCode, $spSubjDRFOCode,
607+
$iErrorCode);
608+
if (!handle_result("VerifyFile (internal)", $iResult, $iErrorCode))
609+
Exit;
610+
611+
print_result('Verified file', $sFileWithVerData);
612+
print_result('Signer info', '');
613+
print_result($sTAB.'subject', $spSubjCN);
614+
print_result($sTAB.'serial', $spSerial);
615+
print_result($sTAB.'issuer', $spIssuerCN);
616+
617+
//----------------------------------------------------------------------------------------
618+
585619
/* Raw sign hash */
586620

587621
$sHash = '';
@@ -1677,6 +1711,69 @@ function ctx_test_hash_itterative($context, $iHashAlgo, $sData, $sCertificate) {
16771711

16781712
//----------------------------------------------------------------------------------------
16791713

1714+
/* Make internal sign from external sign */
1715+
1716+
$sSign = '';
1717+
$sSigner = '';
1718+
$sPreviousSign = '';
1719+
$signerInfo = null;
1720+
$sSignerCert = null;
1721+
1722+
$iResult = euspe_signcreateext(
1723+
$sData, $sSign, $iErrorCode);
1724+
if (!handle_result("SignData (external)", $iResult, $iErrorCode))
1725+
Exit;
1726+
1727+
$iResult = euspe_getsigner(
1728+
0, $sSign, $sSigner, $iErrorCode);
1729+
if (!handle_result("GetSigner", $iResult, $iErrorCode))
1730+
Exit;
1731+
1732+
$iResult = euspe_getsignerinfoex(
1733+
0, $sSign, $signerInfo, $sSignerCert, $iErrorCode);
1734+
if (!handle_result("GetSignerInfoEx", $iResult, $iErrorCode))
1735+
Exit;
1736+
1737+
$iResult = euspe_appendvalidationdatatosigner(
1738+
$sSigner, $sSignerCert, $sSigner, $iErrorCode);
1739+
if (!handle_result("AppendValidationDataToSigner", $iResult, $iErrorCode))
1740+
Exit;
1741+
1742+
$iResult = euspe_createemptysign(
1743+
$sData, $sPreviousSign, $iErrorCode);
1744+
if (!handle_result("CreateEmptySign", $iResult, $iErrorCode))
1745+
Exit;
1746+
1747+
$iResult = euspe_appendsigner(
1748+
$sSigner, $sSignerCert, $sPreviousSign, $sSign, $iErrorCode);
1749+
if (!handle_result("AppendSigner", $iResult, $iErrorCode))
1750+
Exit;
1751+
1752+
print_result('Sign', $sSign);
1753+
1754+
$iResult = euspe_signverify(
1755+
$sSign, $sSignTime, $bIsTSPUse,
1756+
$spIssuer, $spIssuerCN, $spSerial,
1757+
$spSubject, $spSubjCN,
1758+
$spSubjOrg, $spSubjOrgUnit,
1759+
$spSubjTitle, $spSubjState,
1760+
$spSubjLocality, $spSubjFullName,
1761+
$spSubjAddress, $spSubjPhone,
1762+
$spSubjEMail, $spSubjDNS,
1763+
$spSubjEDRPOUCode, $spSubjDRFOCode,
1764+
$sVerData,
1765+
$iErrorCode);
1766+
if (!handle_result("VerifySign (internal)", $iResult, $iErrorCode))
1767+
Exit;
1768+
1769+
print_result('Verified data', $sVerData);
1770+
print_result('Signer info', '');
1771+
print_result($sTAB.'subject', $spSubjCN);
1772+
print_result($sTAB.'serial', $spSerial);
1773+
print_result($sTAB.'issuer', $spIssuerCN);
1774+
1775+
//----------------------------------------------------------------------------------------
1776+
16801777
/* Finalize */
16811778

16821779
euspe_finalize();

0 commit comments

Comments
 (0)