From 05a93163dc67b611a964a3702ea4599087e6b944 Mon Sep 17 00:00:00 2001 From: Artem Vasilev Date: Fri, 4 Nov 2022 16:36:11 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BB=D0=BE=D0=B2=D0=B0=D1=80=D0=B8=20?= =?UTF-8?q?=D1=81=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Dictionary/AbstractDictionary.php | 32 +++++ src/Dictionary/DescriptionAwareInterface.php | 8 ++ src/Dictionary/DictionaryInterface.php | 8 ++ src/Dictionary/DictionaryItem.php | 34 ++++++ src/Dictionary/IssuerTagsDictionary.php | 104 +++++++++++++++++ src/Dictionary/OIDAwareInterface.php | 8 ++ src/Dictionary/OIDAwareTrait.php | 34 ++++++ src/Dictionary/RDNAwareInterface.php | 8 ++ src/Dictionary/RDNAwareTrait.php | 34 ++++++ src/Dictionary/SubjectTagsDictionary.php | 116 +++++++++++++++++++ src/Dictionary/TitleAwareInterface.php | 8 ++ src/Dictionary/TitleAwareTrait.php | 57 +++++++++ 12 files changed, 451 insertions(+) create mode 100755 src/Dictionary/AbstractDictionary.php create mode 100755 src/Dictionary/DescriptionAwareInterface.php create mode 100755 src/Dictionary/DictionaryInterface.php create mode 100755 src/Dictionary/DictionaryItem.php create mode 100755 src/Dictionary/IssuerTagsDictionary.php create mode 100755 src/Dictionary/OIDAwareInterface.php create mode 100755 src/Dictionary/OIDAwareTrait.php create mode 100755 src/Dictionary/RDNAwareInterface.php create mode 100755 src/Dictionary/RDNAwareTrait.php create mode 100755 src/Dictionary/SubjectTagsDictionary.php create mode 100755 src/Dictionary/TitleAwareInterface.php create mode 100755 src/Dictionary/TitleAwareTrait.php diff --git a/src/Dictionary/AbstractDictionary.php b/src/Dictionary/AbstractDictionary.php new file mode 100755 index 0000000..01477cd --- /dev/null +++ b/src/Dictionary/AbstractDictionary.php @@ -0,0 +1,32 @@ +options = $options; + } + + public function __get($name) + { + if (!isset($this->options[$name])) + { + user_error("Can't set property: " . __CLASS__ . "->" . $name); + } + + return $this->options[$name]; + } + + public function __set($name, $value) + { + user_error("Can't set property: " . __CLASS__ . "->" . $name); + } + + public static function getItem(array $options) + { + return new class($options) extends DictionaryItem { + }; + } +} \ No newline at end of file diff --git a/src/Dictionary/IssuerTagsDictionary.php b/src/Dictionary/IssuerTagsDictionary.php new file mode 100755 index 0000000..abdf4c0 --- /dev/null +++ b/src/Dictionary/IssuerTagsDictionary.php @@ -0,0 +1,104 @@ + 'UN', + 'OID' => '1.2.840.113549.1.9.2', + 'title' => 'Неструктурированное имя', + 'title_variants' => ['unstructuredName'], + ], + [ + 'RDN' => 'CN', + 'OID' => '2.5.4.3', + 'title' => 'Удостоверяющий центр', + 'title_variants' => ['commonName'], + ], + [ + 'RDN' => 'C', + 'OID' => '2.5.4.6', + 'title' => 'Страна', + 'title_variants' => ['countryName'], + ], + [ + 'RDN' => 'S', + 'OID' => '2.5.4.8', + 'title' => 'Регион', + 'title_variants' => ['ST', 'stateOrProvinceName'], + ], + [ + 'RDN' => 'STREET', + 'OID' => '2.5.4.9', + 'title' => 'Адрес', + 'title_variants' => ['streetAddress'], + ], + [ + 'RDN' => 'O', + 'OID' => '2.5.4.10', + 'title' => 'Компания', + 'title_variants' => ['organizationName'], + ], + [ + 'RDN' => 'OU', + 'OID' => '2.5.4.11', + 'title' => 'Тип', + 'title_variants' => ['organizationalUnitName'], + ], + [ + 'RDN' => 'T', + 'OID' => '2.5.4.12', + 'title' => 'Должность', + 'title_variants' => ['TITLE'], + ], + [ + 'RDN' => 'OGRN', + 'OID' => '1.2.643.100.1', + 'title' => 'ОГРН', + 'title_variants' => ['ОГРН'], + ], + [ + 'RDN' => 'OGRNIP', + 'OID' => '1.2.643.100.5', + 'title' => 'ОГРНИП', + 'title_variants' => ['ОГРНИП'], + ], + [ + 'RDN' => 'SNILS', + 'OID' => '1.2.643.100.3', + 'title' => 'СНИЛС', + 'title_variants' => ['СНИЛС'], + ], + [ + 'RDN' => 'INN', + 'OID' => '1.2.643.3.131.1.1', + 'title' => 'ИНН', + 'title_variants' => ['ИННФЛ', 'ИНН ФЛ'], + ], + [ + 'RDN' => 'INNLE', + 'OID' => '1.2.643.100.4', + 'title' => 'ИНН организации', + 'title_variants' => ['ИННЮЛ', 'ИНН ЮЛ', 'INN LE'], + ], + [ + 'RDN' => 'E', + 'OID' => '1.2.840.113549.1.9.1', + 'title' => 'Email', + 'title_variants' => ['email', 'emailAddress', 'pkcs9email'], + ], + [ + 'RDN' => 'L', + 'OID' => '2.5.4.7', + 'title' => 'Город', + 'title_variants' => ['localityName'], + ], + ]; +} \ No newline at end of file diff --git a/src/Dictionary/OIDAwareInterface.php b/src/Dictionary/OIDAwareInterface.php new file mode 100755 index 0000000..01a7b4e --- /dev/null +++ b/src/Dictionary/OIDAwareInterface.php @@ -0,0 +1,8 @@ + 'UN', + 'OID' => '1.2.840.113549.1.9.2', + 'title' => 'Неструктурированное имя', + 'title_variants' => ['unstructuredName'], + ], + [ + 'RDN' => 'CN', + 'OID' => '2.5.4.3', + 'title' => 'Владелец', + 'title_variants' => ['commonName'], + ], + [ + 'RDN' => 'SN', + 'OID' => '2.5.4.4', + 'title' => 'Фамилия', + 'title_variants' => ['surname'], + ], + [ + 'RDN' => 'G', + 'OID' => '2.5.4.42', + 'title' => 'Имя Отчество', + 'title_variants' => ['givenName', 'gn'], + ], + [ + 'RDN' => 'C', + 'OID' => '2.5.4.6', + 'title' => 'Страна', + 'title_variants' => ['countryName'], + ], + [ + 'RDN' => 'S', + 'OID' => '2.5.4.8', + 'title' => 'Регион', + 'title_variants' => ['ST', 'stateOrProvinceName'], + ], + [ + 'RDN' => 'STREET', + 'OID' => '2.5.4.9', + 'title' => 'Адрес', + 'title_variants' => ['streetAddress'], + ], + [ + 'RDN' => 'O', + 'OID' => '2.5.4.10', + 'title' => 'Компания', + 'title_variants' => ['organizationName'], + ], + [ + 'RDN' => 'OU', + 'OID' => '2.5.4.11', + 'title' => 'Отдел/подразделение', + 'title_variants' => ['organizationalUnitName'], + ], + [ + 'RDN' => 'T', + 'OID' => '2.5.4.12', + 'title' => 'Должность', + 'title_variants' => ['TITLE'], + ], + [ + 'RDN' => 'OGRN', + 'OID' => '1.2.643.100.1', + 'title' => 'ОГРН', + 'title_variants' => ['ОГРН'], + ], + [ + 'RDN' => 'OGRNIP', + 'OID' => '1.2.643.100.5', + 'title' => 'ОГРНИП', + 'title_variants' => ['ОГРНИП'], + ], + [ + 'RDN' => 'SNILS', + 'OID' => '1.2.643.100.3', + 'title' => 'СНИЛС', + 'title_variants' => ['СНИЛС'], + ], + [ + 'RDN' => 'INN', + 'OID' => '1.2.643.3.131.1.1', + 'title' => 'ИНН', + 'title_variants' => ['ИННФЛ', 'ИНН ФЛ'], + ], + [ + 'RDN' => 'INNLE', + 'OID' => '1.2.643.100.4', + 'title' => 'ИНН организации', + 'title_variants' => ['ИННЮЛ', 'ИНН ЮЛ', 'INN LE'], + ], + [ + 'RDN' => 'E', + 'OID' => '1.2.840.113549.1.9.1', + 'title' => 'Email', + 'title_variants' => ['email', 'emailAddress', 'pkcs9email'], + ], + [ + 'RDN' => 'L', + 'OID' => '2.5.4.7', + 'title' => 'Город', + 'title_variants' => ['localityName'], + ], + ]; +} \ No newline at end of file diff --git a/src/Dictionary/TitleAwareInterface.php b/src/Dictionary/TitleAwareInterface.php new file mode 100755 index 0000000..5ce0a6c --- /dev/null +++ b/src/Dictionary/TitleAwareInterface.php @@ -0,0 +1,8 @@ +