Skip to main content

Module authentication

Module authentication 

Source
Expand description

Sans-IO MTProto authorization key generation.

§Flow

let (req, s1) = authentication::step1()?;
// send req, receive resp
let (req, s2) = authentication::step2(s1, resp)?;
// send req, receive resp
let (req, s3) = authentication::step3(s2, resp)?;
// send req, receive resp
let done = authentication::finish(s3, resp)?;
// done.auth_key is ready

Structs§

Finished
The final output of a successful auth key handshake.
Step1
State after step 1.
Step2
State after step 2.
Step3
State after step 3.

Enums§

Error
Errors that can occur during auth key generation.

Functions§

finish
Finalise the handshake. Returns the ready Finished on success.
key_for_fingerprint
RSA key by server fingerprint. Includes both production and test DC keys.
step1
Generate a req_pq_multi request. Returns the request + opaque state.
step2
Process ResPQ and generate req_DH_params.
step3
Process ServerDhParams and generate set_client_DH_params.