auth.bindTempAuthKey
Binds a temporary authorization key temp_auth_key_id to the permanent authorization key perm_auth_key_id. Each permanent key may only be bound to one temporary key at a time, binding a new temporary key overwrites the previous one. For more information, see Perfect Forward Secrecy.
func (c *Client) AuthBindTempAuthKey(ctx context.Context, request *AuthBindTempAuthKeyRequest) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AuthBindTempAuthKey(ctx, &tg.AuthBindTempAuthKeyRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
PermAuthKeyID | int64 | yes | Permanent auth_key_id to bind to |
Nonce | int64 | yes | Random long from Binding message contents |
ExpiresAt | int | yes | Unix timestamp to invalidate temporary key, see Binding message contents |
EncryptedMessage | []byte | yes | See Generating encrypted_message |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | ENCRYPTED_MESSAGE_INVALID | Encrypted message invalid. |
| 400 | EXPIRES_AT_INVALID | The specified expires_at timestamp is invalid. |
| 400 | TEMP_AUTH_KEY_ALREADY_BOUND | The passed temporary key is already bound to another perm_auth_key_id. |
| 400 | TEMP_AUTH_KEY_EMPTY | No temporary auth key provided. |
References
- Official documentation
- Generated Go reference
- TL definition:
auth.bindTempAuthKey#cdd42a05