diff --git a/.gitattributes b/.gitattributes old mode 100755 new mode 100644 diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml old mode 100755 new mode 100644 diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 1e2452e..c360f4d --- a/README.md +++ b/README.md @@ -1 +1,59 @@ -# PHP API для работы с бибилотекой КриптоПро libphpcades \ No newline at end of file + +# КриптоПРО PHP SDK +PHP SDK для работы с API расширения КриптоПро (`libphpcades`), аналогичный КриптоПро ЭЦП Browser plug-in + +- [КриптоПРО PHP SDK](#cryptopro-php) + - [Зачем нужен этот пакет?](#why) + - [Установка](#install) + - [API](#api) + - [Методы класса CryptoPro](#api-cryptopro) + - [Методы объекта сертификата](#api-certificate) + - [Поддерживаемые СКЗИ](#supported-cist) + - [Примеры](#examples) + - [Тэг script (UMD)](#example-script-tag) +- [Тем, кто хочет помочь](#developers) + - [Запуск режима разработки](#dev-mode) + - [Запуск тестов](#tests-execution) + - [Проверка пакета перед публикацией в NPM](#final-check) +- [Лицензия](#lisense) + + + +## Зачем нужен этот пакет? +Этот паект призван упроостить взаимодействие с абсолютно не документированным [расширением КриптоПро для PHP](https://docs.cryptopro.ru/cades/phpcades). +Пакет реализует упрощённый доступ к следующим операциям: +- работа с сертификатами; +- создание и проверка подписи; +- шифрование и расшифрование данных. + +Немаловажным фактором, в выборе этого пакета, является полное соответсвие набора методов, с [КриптоПРО JS SDK](https://github.com/webmasterskaya/crypto-pro-js) + + +## Установка + +Установка осуществляется через [Composer](https://getcomposer.org/). +```shell +composer require webmasterskaya/crypto-pro-php +``` + + +## API + + +### Методы класса СryptoPro +- [СryptoPro::getUserCertificates()](docs/api/CryptoPro/getUserCertificates.md) - возвращает список сертификатов, доступных пользователю в системе +- [СryptoPro::getAllUserCertificates()](docs/api/CryptoPro/getAllUserCertificates.md) - возвращает список всех сертификатов, доступных пользователю в системе, в том числе, просроченные и без закрытого ключа +- [СryptoPro::getContainerCertificates()](docs/api/CryptoPro/getContainerCertificates.md) - возвращает список сертификатов, из закрытых ключей и/или сертификаты не установленные всистеме* +- [СryptoPro::getAllContainerCertificates()](docs/api/CryptoPro/getAllContainerCertificates.md) - возвращает список всех сертификатов, из закрытых ключей и/или сертификаты не установленные всистеме*, в том числе, просроченные и без закрытого ключа +- [СryptoPro::getCertificate()](docs/api/CryptoPro/getCertificate.md) - возвращает сертификат по отпечатку +- [СryptoPro::createAttachedSignature()](docs/api/CryptoPro/createAttachedSignature.md) - создает совмещенную (присоединенную) подпись сообщения +- [СryptoPro::createDetachedSignature()](docs/api/CryptoPro/createDetachedSignature.md) - создает отсоединенную (открепленную) подпись сообщения +- [СryptoPro::addAttachedSignature()](docs/api/CryptoPro/addAttachedSignature.md) - добавляет совмещенную (присоединенную) подпись к раннее подписанному документу (реализует метод coSign) +- [СryptoPro::addDetachedSignature()](docs/api/CryptoPro/addDetachedSignature.md) - добавляет отсоединенную (открепленную) подпись к раннее подписанному документу (реализует метод coSign) +- [СryptoPro::createHash()](docs/api/CryptoPro/createHash.md) - создает хеш сообщения по ГОСТ Р 34.11-2012 256 бит +- [СryptoPro::getSystemInfo()](docs/api/CryptoPro/getSystemInfo.md) - возвращает информацию о CSP и плагине +- [СryptoPro::isValidSystemSetup()](docs/api/CryptoPro/isValidSystemSetup.md) - возвращает флаг корректности настроек ЭП на машине + + + +### Методы объекта сертификата \ No newline at end of file diff --git a/composer.json b/composer.json old mode 100755 new mode 100644 diff --git a/doc/ATTRIBUTES.md b/doc/ATTRIBUTES.md old mode 100755 new mode 100644 diff --git a/doc/GET-TEST-CERT.md b/doc/GET-TEST-CERT.md old mode 100755 new mode 100644 diff --git a/docs/api/CryptoPro/addAttachedSignature.md b/docs/api/CryptoPro/addAttachedSignature.md new file mode 100644 index 0000000..77a6fb4 --- /dev/null +++ b/docs/api/CryptoPro/addAttachedSignature.md @@ -0,0 +1 @@ +# CryptoPro::addAttachedSignature diff --git a/docs/api/CryptoPro/addDetachedSignature.md b/docs/api/CryptoPro/addDetachedSignature.md new file mode 100644 index 0000000..f566cbf --- /dev/null +++ b/docs/api/CryptoPro/addDetachedSignature.md @@ -0,0 +1 @@ +# CryptoPro::addDetachedSignature diff --git a/docs/api/CryptoPro/createAttachedSignature.md b/docs/api/CryptoPro/createAttachedSignature.md new file mode 100644 index 0000000..213c62b --- /dev/null +++ b/docs/api/CryptoPro/createAttachedSignature.md @@ -0,0 +1 @@ +# CryptoPro::createAttachedSignature \ No newline at end of file diff --git a/docs/api/CryptoPro/createDetachedSignature.md b/docs/api/CryptoPro/createDetachedSignature.md new file mode 100644 index 0000000..d13b7ac --- /dev/null +++ b/docs/api/CryptoPro/createDetachedSignature.md @@ -0,0 +1 @@ +# CryptoPro::createDetachedSignature \ No newline at end of file diff --git a/docs/api/CryptoPro/createHash.md b/docs/api/CryptoPro/createHash.md new file mode 100644 index 0000000..5375109 --- /dev/null +++ b/docs/api/CryptoPro/createHash.md @@ -0,0 +1 @@ +# CryptoPro::createHash \ No newline at end of file diff --git a/docs/api/CryptoPro/getAllContainerCertificates.md b/docs/api/CryptoPro/getAllContainerCertificates.md new file mode 100644 index 0000000..6b9bede --- /dev/null +++ b/docs/api/CryptoPro/getAllContainerCertificates.md @@ -0,0 +1 @@ +# CryptoPro::getAllContainerCertificates \ No newline at end of file diff --git a/docs/api/CryptoPro/getAllUserCertificates.md b/docs/api/CryptoPro/getAllUserCertificates.md new file mode 100644 index 0000000..cb573c4 --- /dev/null +++ b/docs/api/CryptoPro/getAllUserCertificates.md @@ -0,0 +1 @@ +# CryptoPro::getAllUserCertificates \ No newline at end of file diff --git a/docs/api/CryptoPro/getCertificate.md b/docs/api/CryptoPro/getCertificate.md new file mode 100644 index 0000000..e48d418 --- /dev/null +++ b/docs/api/CryptoPro/getCertificate.md @@ -0,0 +1 @@ +# CryptoPro::getCertificate \ No newline at end of file diff --git a/docs/api/CryptoPro/getContainerCertificates.md b/docs/api/CryptoPro/getContainerCertificates.md new file mode 100644 index 0000000..b6a2ae3 --- /dev/null +++ b/docs/api/CryptoPro/getContainerCertificates.md @@ -0,0 +1 @@ +# CryptoPro::getContainerCertificates \ No newline at end of file diff --git a/docs/api/CryptoPro/getSystemInfo.md b/docs/api/CryptoPro/getSystemInfo.md new file mode 100644 index 0000000..d1c551e --- /dev/null +++ b/docs/api/CryptoPro/getSystemInfo.md @@ -0,0 +1 @@ +# CryptoPro::getSystemInfo \ No newline at end of file diff --git a/docs/api/CryptoPro/getUserCertificates.md b/docs/api/CryptoPro/getUserCertificates.md new file mode 100644 index 0000000..bdb42ab --- /dev/null +++ b/docs/api/CryptoPro/getUserCertificates.md @@ -0,0 +1 @@ +# CryptoPro::getUserCertificates \ No newline at end of file diff --git a/docs/api/CryptoPro/isValidSystemSetup.md b/docs/api/CryptoPro/isValidSystemSetup.md new file mode 100644 index 0000000..2b0271b --- /dev/null +++ b/docs/api/CryptoPro/isValidSystemSetup.md @@ -0,0 +1 @@ +# CryptoPro::isValidSystemSetup diff --git a/examples/list_of_all_valid_certificates.php b/examples/list_of_all_valid_certificates.php old mode 100755 new mode 100644 diff --git a/phpstan.neon b/phpstan.neon old mode 100755 new mode 100644 diff --git a/src/Certificate.php b/src/Certificate.php old mode 100755 new mode 100644 diff --git a/src/Constants/CADESCOM_ATTRIBUTE.php b/src/Constants/CADESCOM_ATTRIBUTE.php old mode 100755 new mode 100644 diff --git a/src/Constants/CADESCOM_CADES_TYPE.php b/src/Constants/CADESCOM_CADES_TYPE.php old mode 100755 new mode 100644 diff --git a/src/Constants/CADESCOM_CONTENT_ENCODING_TYPE.php b/src/Constants/CADESCOM_CONTENT_ENCODING_TYPE.php old mode 100755 new mode 100644 diff --git a/src/Constants/CADESCOM_DISPLAY_DATA.php b/src/Constants/CADESCOM_DISPLAY_DATA.php old mode 100755 new mode 100644 diff --git a/src/Constants/CADESCOM_ENCODING_TYPE.php b/src/Constants/CADESCOM_ENCODING_TYPE.php old mode 100755 new mode 100644 diff --git a/src/Constants/CADESCOM_ENCRYPTION_ALGORITHM.php b/src/Constants/CADESCOM_ENCRYPTION_ALGORITHM.php old mode 100755 new mode 100644 diff --git a/src/Constants/CADESCOM_HASH_ALGORITHM.php b/src/Constants/CADESCOM_HASH_ALGORITHM.php old mode 100755 new mode 100644 diff --git a/src/Constants/CADESCOM_STORE_LOCATION.php b/src/Constants/CADESCOM_STORE_LOCATION.php old mode 100755 new mode 100644 diff --git a/src/Constants/CAPICOM_CERTIFICATE_FIND_TYPE.php b/src/Constants/CAPICOM_CERTIFICATE_FIND_TYPE.php old mode 100755 new mode 100644 diff --git a/src/Constants/CAPICOM_CERTIFICATE_INCLUDE_OPTION.php b/src/Constants/CAPICOM_CERTIFICATE_INCLUDE_OPTION.php old mode 100755 new mode 100644 diff --git a/src/Constants/CAPICOM_PROPID.php b/src/Constants/CAPICOM_PROPID.php old mode 100755 new mode 100644 diff --git a/src/Constants/CAPICOM_STORE_LOCATION.php b/src/Constants/CAPICOM_STORE_LOCATION.php old mode 100755 new mode 100644 diff --git a/src/Constants/CAPICOM_STORE_OPEN_MODE.php b/src/Constants/CAPICOM_STORE_OPEN_MODE.php old mode 100755 new mode 100644 diff --git a/src/CryptoPro.php b/src/CryptoPro.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/AbstractDictionary.php b/src/Dictionary/AbstractDictionary.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/AbstractTagsDictionary.php b/src/Dictionary/AbstractTagsDictionary.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/AdditionalTagsDictionary.php b/src/Dictionary/AdditionalTagsDictionary.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/DescriptionAwareInterface.php b/src/Dictionary/DescriptionAwareInterface.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/DictionaryInterface.php b/src/Dictionary/DictionaryInterface.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/DictionaryItem.php b/src/Dictionary/DictionaryItem.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/IssuerTagsDictionary.php b/src/Dictionary/IssuerTagsDictionary.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/OIDAwareInterface.php b/src/Dictionary/OIDAwareInterface.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/OIDAwareTrait.php b/src/Dictionary/OIDAwareTrait.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/OIDDictionary.php b/src/Dictionary/OIDDictionary.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/RDNAwareInterface.php b/src/Dictionary/RDNAwareInterface.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/RDNAwareTrait.php b/src/Dictionary/RDNAwareTrait.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/StandardTagsDictionary.php b/src/Dictionary/StandardTagsDictionary.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/SubjectTagsDictionary.php b/src/Dictionary/SubjectTagsDictionary.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/TitleAwareInterface.php b/src/Dictionary/TitleAwareInterface.php old mode 100755 new mode 100644 diff --git a/src/Dictionary/TitleAwareTrait.php b/src/Dictionary/TitleAwareTrait.php old mode 100755 new mode 100644 diff --git a/src/Helpers/ArrayHelper.php b/src/Helpers/ArrayHelper.php old mode 100755 new mode 100644 diff --git a/src/Helpers/CertificateHelper.php b/src/Helpers/CertificateHelper.php old mode 100755 new mode 100644 diff --git a/src/Helpers/ErrorMessageHelper.php b/src/Helpers/ErrorMessageHelper.php old mode 100755 new mode 100644 diff --git a/src/Helpers/Messages/HumanReadebleCPErrors.php b/src/Helpers/Messages/HumanReadebleCPErrors.php old mode 100755 new mode 100644 diff --git a/tmp/src.txt b/tmp/src.txt old mode 100755 new mode 100644