PHPackages                             mfiyalka/telegram-passport - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. mfiyalka/telegram-passport

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

mfiyalka/telegram-passport
==========================

Library for Telegram Passport

v1.0.0(7y ago)420MITPHP

Since Aug 2Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mfiyalka/telegram-passport)[ Packagist](https://packagist.org/packages/mfiyalka/telegram-passport)[ RSS](/packages/mfiyalka-telegram-passport/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Telegram Passport
=================

[](#telegram-passport)

Install
-------

[](#install)

```
composer require mfiyalka/telegram-passport "*"
```

```
...
"require": {
        "mfiyalka/telegram-passport": "*"
    }
...
```

Генеруємо приватний ключ, який поміщаємо в директорію config/telegram

```
openssl genrsa 2048 > private.key
```

Тепер генеруємо публічний ключ, який також поміщаємо в директорію config/telegram під іменем public.key

```
openssl rsa -in private.key -pubout
```

Use the **/setpublickey** command with @BotFather to connect this public key with your bot.

Скопіюйте конфігураційний файл /vendor/mfiyalka/telegram-passport/config/telegram\_passport.php в директорію /config

Examples:
---------

[](#examples)

```
{
    "passport_data": {
        "data": [
            {
                "type": "personal_details",
                "data": "..."
            },
            {
                "type": "passport",
                 "data": "...",
                "front_side": {
                    "file_id": "...",
                    "file_size": 1690656,
                    "file_date": 1532965670
                }
            },
            {
                "type": "driver_license",
                "data": "",
                "front_side": {
                    "file_id": "...",
                    "file_date": 1533211580
                },
                "reverse_side": {
                    "file_id": "...",
                    "file_date": 1533211580
                }
            },
            {
                "type": "address",
                "data": "..."
            },
            {
                "type": "utility_bill",
                "files": [
                    {
                        "file_id": "...",
                        "file_date": 1532965834
                    },
                    {
                        "file_id": "...",
                        "file_date": 1533213517
                    }
                ]
            },
            {
                "type": "rental_agreement",
                "files": [
                    {
                        "file_id": "...",
                        "file_date": 1533213500
                    }
                ]
            },
            {
                "type": "phone_number",
                "phone_number": "..."
            },
            {
                "type": "email",
                "email": "..."
            }
        ],
        "credentials": {
            "data": "...",
            "hash": "...",
            "secret": "..."
        }
    }
}
```

```
