Skip to content

miniproto.auth.key_exchange.AuthKeyExchange.create_auth_key

miniproto.auth.key_exchange.AuthKeyExchange.create_auth_key

Section titled “miniproto.auth.key_exchange.AuthKeyExchange.create_auth_key”
create_auth_key() -> AuthKeyExchangeResult

Execute one complete Telegram authorization-key exchange.

The method validates nonces, trusted RSA fingerprint selection, encrypted server DH data, the safe DH group, public values, and Telegram’s final new_nonce_hash1 confirmation before returning secret key material.

Returns:

  • AuthKeyExchangeResult – The new MTProto authorization key, its key ID, server salt, time offset, and DC ID.

Raises:

  • ValueError – If any Telegram handshake proof, nonce, key, DH parameter, or final confirmation is invalid.
  • TLCodecError – If a handshake payload has an unexpected constructor or malformed encoding.