blob: b50805ad7a6e76f5a67af838d2726b234ae71f7d [file] [edit]
// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef OSP_PUBLIC_AUTHENTICATION_BOB_H_
#define OSP_PUBLIC_AUTHENTICATION_BOB_H_
#include <string>
#include <vector>
#include "osp/public/authentication_base.h"
namespace openscreen::osp {
// AuthenticationBob is the PSK consumer, which requires user to input PSK for
// verification.
class AuthenticationBob final : public AuthenticationBase {
public:
AuthenticationBob(uint64_t instance_id,
AgentFingerprint fingerprint,
MessageDemuxer& demuxer,
Delegate& delegate);
AuthenticationBob(const AuthenticationBob&) = delete;
AuthenticationBob& operator=(const AuthenticationBob&) = delete;
AuthenticationBob(AuthenticationBob&&) noexcept = delete;
AuthenticationBob& operator=(AuthenticationBob&&) noexcept = delete;
virtual ~AuthenticationBob();
// AuthenticationBase overrides.
void StartAuthentication() override;
ErrorOr<size_t> OnStreamMessage(uint64_t instance_id,
uint64_t connection_id,
msgs::Type message_type,
const uint8_t* buffer,
size_t buffer_size,
Clock::time_point now) override;
};
} // namespace openscreen::osp
#endif // OSP_PUBLIC_AUTHENTICATION_BOB_H_