# telegram.EncryptedPassportElement

class telegram.EncryptedPassportElement(type, data=None, phone_number=None, email=None, files=None, front_side=None, reverse_side=None, selfie=None, translation=None, hash=None, bot=None, credentials=None, **_kwargs)

  Bases: `telegram.base.TelegramObject`

  Contains information about documents or other Telegram Passport elements shared with the bot by the user. The data has been automatically decrypted by python-telegram-bot.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `type`, `data`, `phone_number`, `email`, `files`, `front_side`, `reverse_side` and `selfie` are equal.

  Note

  This object is decrypted only when originating from `telegram.PassportData.decrypted_data`.

  Parameters

    - type (`str`) – Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.

    - data (`telegram.PersonalDetails` | `telegram.IdDocument` | `telegram.ResidentialAddress` | `str`, optional) – Decrypted or encrypted data, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “identity_passport” and “address” types.

    - phone_number (`str`, optional) – User’s verified phone number, available only for “phone_number” type.

    - email (`str`, optional) – User’s verified email address, available only for “email” type.

    - files (List[`telegram.PassportFile`], optional) – Array of encrypted/decrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types.

    - front_side (`telegram.PassportFile`, optional) – Encrypted/decrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”.

    - reverse_side (`telegram.PassportFile`, optional) – Encrypted/decrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”.

    - selfie (`telegram.PassportFile`, optional) – Encrypted/decrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”.

    - translation (List[`telegram.PassportFile`], optional) – Array of encrypted/decrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types.

    - hash (`str`) – Base64-encoded element hash for using in `telegram.PassportElementErrorUnspecified`.

    - bot (`telegram.Bot`, optional) – The Bot to use for instance methods.

    - **kwargs (`dict`) – Arbitrary keyword arguments.

  type

    Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.

    Type

      `str`

  data

    Optional. Decrypted or encrypted data, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “identity_passport” and “address” types.

    Type

      `telegram.PersonalDetails` | `telegram.IdDocument` | `telegram.ResidentialAddress` | `str`

  phone_number

    Optional. User’s verified phone number, available only for “phone_number” type.

    Type

      `str`

  email

    Optional. User’s verified email address, available only for “email” type.

    Type

      `str`

  files

    Optional. Array of encrypted/decrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types.

    Type

      List[`telegram.PassportFile`]

  front_side

    Optional. Encrypted/decrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”.

    Type

      `telegram.PassportFile`

  reverse_side

    Optional. Encrypted/decrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”.

    Type

      `telegram.PassportFile`

  selfie

    Optional. Encrypted/decrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”.

    Type

      `telegram.PassportFile`

  translation

    Optional. Array of encrypted/decrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types.

    Type

      List[`telegram.PassportFile`]

  hash

    Base64-encoded element hash for using in `telegram.PassportElementErrorUnspecified`.

    Type

      `str`

  bot

    Optional. The Bot to use for instance methods.

    Type

      `telegram.Bot`

  classmethod de_json(data, bot)

    See `telegram.TelegramObject.de_json()`.

  classmethod de_json_decrypted(data, bot, credentials)

    Variant of `telegram.TelegramObject.de_json()` that also takes into account passport credentials.

    Parameters

      - data (Dict[`str`, …]) – The JSON data.

      - bot (`telegram.Bot`) – The bot associated with this object.

      - credentials (`telegram.FileCredentials`) – The credentials

    Returns

    Return type

      `telegram.EncryptedPassportElement`

  to_dict()

    See `telegram.TelegramObject.to_dict()`.