* Create a NetworkAuthenticationClientHandler. * @param password_handler The handler for when a request for password needs to be passed on to the user. * @param secret_key The location where the secret key is stored; can be overwritten when invalid. * @param public_key The location where the public key is stored; can be overwritten when invalid. */ static */
| 460 | * @param public_key The location where the public key is stored; can be overwritten when invalid. |
| 461 | */ |
| 462 | /* static */ std::unique_ptr<NetworkAuthenticationClientHandler> NetworkAuthenticationClientHandler::Create(std::shared_ptr<NetworkAuthenticationPasswordRequestHandler> password_handler, std::string &secret_key, std::string &public_key) |
| 463 | { |
| 464 | auto secret = X25519AuthorizedKeyClientHandler::GetValidSecretKeyAndUpdatePublicKey(secret_key, public_key); |
| 465 | auto handler = std::make_unique<CombinedAuthenticationClientHandler>(); |
| 466 | handler->Add(std::make_unique<X25519KeyExchangeOnlyClientHandler>(secret)); |
| 467 | handler->Add(std::make_unique<X25519PAKEClientHandler>(secret, std::move(password_handler))); |
| 468 | handler->Add(std::make_unique<X25519AuthorizedKeyClientHandler>(secret)); |
| 469 | return handler; |
| 470 | } |
| 471 | |
| 472 | /** |
| 473 | * Create a NetworkAuthenticationServerHandler. |