Немного документации

This commit is contained in:
Artem Vasilev 2022-11-03 19:40:26 +03:00
parent 073e61fa6f
commit 1ddf5b63b9

View File

@ -14,150 +14,201 @@ class CPCertificates
/** /**
* Возвращает коллекцию сертификатов, удовлетворяющих заданному критерию. * Возвращает коллекцию сертификатов, удовлетворяющих заданному критерию.
* *
* @param int $FindType Тип критериев сопоставления, предоставленных в параметре varCriteria. * @param int $FindType Тип критериев сопоставления, предоставленных в параметре varCriteria.
* Может принимать следующие значения: * Может принимать следующие значения:
* <table> * <table>
* <thead> * <thead>
* <tr> * <tr>
* <th>Значение</th> * <th>Значение</th>
* <th>Пояснение</th> * <th>Пояснение</th>
* </tr> * </tr>
* </thead> * </thead>
* <tbody> * <tbody>
* <tr> * <tr>
* <td> * <td>
* CERTIFICATE_FIND_SHA1_HASH * CERTIFICATE_FIND_SHA1_HASH
* </td> * </td>
* <td> * <td>
* Returns certificates with a SHA1 hash that matches * Returns certificates with a SHA1 hash that matches
* the SHA1 hash specified in the <em>varCriteria</em> parameter. * the SHA1 hash specified in the <em>varCriteria</em> parameter.
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> * <td>
* CERTIFICATE_FIND_SUBJECT_NAME * CERTIFICATE_FIND_SUBJECT_NAME
* </td> * </td>
* <td> * <td>
* Returns certificates whose subject name exactly * Returns certificates whose subject name exactly
* or partially matches the subject name specified in the * or partially matches the subject name specified in the
* <em>varCriteria</em> parameter. This call searches the subject name field only. * <em>varCriteria</em> parameter. This call searches the subject name field only.
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> * <td>
* CERTIFICATE_FIND_ISSUER_NAME * CERTIFICATE_FIND_ISSUER_NAME
* </td> * </td>
* <td> * <td>
* Returns certificates whose issuer name exactly * Returns certificates whose issuer name exactly
* or partially matches the issuer name specified in the * or partially matches the issuer name specified in the
* <em>varCriteria</em> parameter. This call searches the issuer name field only. * <em>varCriteria</em> parameter. This call searches the issuer name field only.
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> * <td>
* CERTIFICATE_FIND_ROOT_NAME * CERTIFICATE_FIND_ROOT_NAME
* </td> * </td>
* <td> * <td>
* Returns certificates whose root subject name exactly * Returns certificates whose root subject name exactly
* or partially matches the root subject name specified in * or partially matches the root subject name specified in
* the <em>varCriteria</em> parameter. This call creates a chain. * the <em>varCriteria</em> parameter. This call creates a chain.
* This call searches the subject name field of the root certificate. * This call searches the subject name field of the root certificate.
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> * <td>
* CERTIFICATE_FIND_TEMPLATE_NAME * CERTIFICATE_FIND_TEMPLATE_NAME
* </td> * </td>
* <td> * <td>
* Returns certificates whose template name matches * Returns certificates whose template name matches
* the template name specified in the <em>varCriteria</em> parameter. * the template name specified in the <em>varCriteria</em> parameter.
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> * <td>
* CERTIFICATE_FIND_EXTENSION * CERTIFICATE_FIND_EXTENSION
* </td> * </td>
* <td> * <td>
* Returns certificates that have an extension * Returns certificates that have an extension
* that matches the extension specified in the * that matches the extension specified in the
* <em>varCriteria</em> parameter. * <em>varCriteria</em> parameter.
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> * <td>
* CERTIFICATE_FIND_EXTENDED_PROPERTY * CERTIFICATE_FIND_EXTENDED_PROPERTY
* </td> * </td>
* <td> * <td>
* Returns certificates in the store that explicitly * Returns certificates in the store that explicitly
* contain an extended property with the value specified * contain an extended property with the value specified
* in the <em>varCriteria</em> parameter. * in the <em>varCriteria</em> parameter.
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> * <td>
* CERTIFICATE_FIND_APPLICATION_POLICY * CERTIFICATE_FIND_APPLICATION_POLICY
* </td> * </td>
* <td> * <td>
* Returns certificates in the store that have * Returns certificates in the store that have
* either an enhanced key usage extension, application policy extension, * either an enhanced key usage extension, application policy extension,
* or extended property specified in the <em>varCriteria</em> parameter. * or extended property specified in the <em>varCriteria</em> parameter.
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> * <td>
* CERTIFICATE_FIND_CERTIFICATE_POLICY * CERTIFICATE_FIND_CERTIFICATE_POLICY
* </td> * </td>
* <td> * <td>
* Returns certificates that contain the policy OID * Returns certificates that contain the policy OID
* in the Certificate Policy extension specified * in the Certificate Policy extension specified
* in the <em>varCriteria</em> parameter. * in the <em>varCriteria</em> parameter.
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> * <td>
* CERTIFICATE_FIND_TIME_VALID * CERTIFICATE_FIND_TIME_VALID
* </td> * </td>
* <td> * <td>
* Returns certificates whose time is valid. * Returns certificates whose time is valid.
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> * <td>
* CERTIFICATE_FIND_TIME_NOT_YET_VALID * CERTIFICATE_FIND_TIME_NOT_YET_VALID
* </td> * </td>
* <td> * <td>
* Returns certificates whose time is not yet valid. * Returns certificates whose time is not yet valid.
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> * <td>
* CERTIFICATE_FIND_TIME_EXPIRED * CERTIFICATE_FIND_TIME_EXPIRED
* </td> * </td>
* <td> * <td>
* Returns certificates whose time has expired. * Returns certificates whose time has expired.
* </td> * </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> * <td>
* CERTIFICATE_FIND_KEY_USAGE * CERTIFICATE_FIND_KEY_USAGE
* </td> * </td>
* <td> * <td>
* Returns certificates containing key usages in the * Returns certificates containing key usages in the
* KeyUsage extension specified in the <em>varCriteria</em> * KeyUsage extension specified in the <em>varCriteria</em>
* parameter. If the KeyUsage extension is not present, * parameter. If the KeyUsage extension is not present,
* all of the key usages are assumed to be unavailable. * all of the key usages are assumed to be unavailable.
* </td> * </td>
* </tr> * </tr>
* </tbody> * </tbody>
* </table> * </table>
* @param mixed $varCriteria (optional) Вариант, содержащий критерии поиска. * @param mixed $varCriteria Вариант, содержащий критерии поиска.
* Эти данные должны соответствовать типу данных, указанному в параметре FindType. * Эти данные должны соответствовать типу данных, указанному в параметре FindType.
* @param bool $bFindValidOnly (optional) Логическое значение, указывающее, возвращаются ли только действительные сертификаты. * <table>
* <thead>
* <tr>
* <th>FindType</th>
* <th>Тип данных</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td>
* CAPICOM_CERTIFICATE_FIND_SHA1_HASH,
* CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME,
* CAPICOM_CERTIFICATE_FIND_ISSUER_NAME,
* CAPICOM_CERTIFICATE_FIND_ROOT_NAME,
* CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME,
* CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY
* </td>
* <td>
* string
* </td>
* </tr>
* <tr>
* <td>
* CERTIFICATE_FIND_EXTENDED_PROPERTY,
* CERTIFICATE_FIND_KEY_USAGE
* </td>
* <td>
* int
* </td>
* </tr>
* <tr>
* <td>
* CAPICOM_CERTIFICATE_FIND_TIME_VALID,
* CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID,
* CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED
* </td>
* <td>
* string (входная строка для бъекта CDateTime, https://docs.cryptopro.ru/pki/cplib/class/cdatetime?id=cdatetime)
* </td>
* </tr>
* </tbody>
* </table>
*
* @param bool|int $bFindValidOnly Логическое значение , указывающее, возвращаются ли только действительные сертификаты.
* Если значение равно false, возвращаются все сертификаты, соответствующие условиям поиска.
* Если значение равно true, поиск не вернет следующие типы сертификатов:
* <ul>
* <li>Сертификаты, срок действия которых истек или еще не действителен.</li>
* <li>Сертификаты не связаны должным образом.</li>
* <li>Сертификаты, у которых возникли проблемы с подписью.</li>
* <li>Отозванные сертификаты.</li>
* </ul>
* *
* @return CPCertificates * @return CPCertificates
*/ */
public function Find( public function Find(
int $FindType, $varCriteria = 0, bool $bFindValidOnly = false int $FindType, $varCriteria, $bFindValidOnly
) )
{ {
} }