*/ class implementation_client_srp implements interface_client { /** * @param function,string> $generate_salt * @param function,void> $registration_send * @param function,record> $login_handle1 * @param function,record> $login_handle2 * @author Christian Fraß */ public function __construct( struct_srp_subject $subject, \Closure $generate_salt, \Closure $register_handle, \Closure $login_handle1, \Closure $login_handle2 ) { $this->subject = $subject; $this->generate_salt = $generate_salt; $this->register_handle = $register_handle; $this->login_handle1 = $login_handle1; $this->login_handle2 = $login_handle2; } /** * @implementation * @author Christian Fraß */ public function register( string $username, string $password ) : bool { $proc = srp_client_register( $this->subject, $this->generate_salt, $this->register_handle ); return $proc($username, $password); } /** * @implementation * @author Christian Fraß */ public function passwordchange( string $password ) : bool { throw (new Exception('not implemented')); } /** * @implementation * @author Christian Fraß */ public function passwordreset( string $username, string $password, string $key ) : bool { throw (new Exception('not implemented')); } /** * @implementation * @author Christian Fraß */ public function login( string $username, string $password ) : bool { $proc = srp_client_login( $this->subject, $this->login_handle1, $this->login_handle2 ); return $proc($username, $password); } } ?>