AuthenticationSecure.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2023 SICK AG, Waldkirch
3 //
4 // SPDX-License-Identifier: Unlicense
5 
6 #pragma once
7 #include <array>
8 
9 #include "CoLaParameterReader.h"
10 #include "VisionaryControl.h"
11 
12 namespace visionary {
14 {
18 };
20 {
21  std::array<std::uint8_t, 16> challenge;
22  std::array<std::uint8_t, 16> salt;
23 };
24 
25 typedef std::array<std::uint8_t, 32> PasswordHash;
26 typedef std::array<std::uint8_t, 32> ChallengeResponse;
27 
29 {
30 public:
31  explicit AuthenticationSecure(VisionaryControl& vctrl);
32  ~AuthenticationSecure() override;
33 
34  bool login(UserLevel userLevel, const std::string& password) override;
35  bool logout() override;
36 
37 private:
40 
42  const std::string& password,
43  const ChallengeRequest& challengeRequest,
44  ProtocolType protocolType);
46  const std::string& password,
47  const ChallengeRequest& challengeRequest,
48  ProtocolType protocolType);
49  bool loginImpl(UserLevel userLevel,
50  const std::string& password,
51  const CoLaParameterReader& getChallengeResponse,
52  ProtocolType protocolType);
53 };
54 
55 } // namespace visionary
VisionaryControl.h
visionary::IAuthentication::UserLevel
UserLevel
Available CoLa user levels.
Definition: IAuthentication.h:15
visionary::CoLaParameterReader
Class for reading data from a CoLaCommand.
Definition: CoLaParameterReader.h:17
visionary::AuthenticationSecure::logout
bool logout() override
Definition: AuthenticationSecure.cpp:199
visionary::AuthenticationSecure::CreatePasswordHash
PasswordHash CreatePasswordHash(UserLevel userLevel, const std::string &password, const ChallengeRequest &challengeRequest, ProtocolType protocolType)
Definition: AuthenticationSecure.cpp:31
visionary::ProtocolType
ProtocolType
Definition: AuthenticationSecure.h:13
visionary
Definition: MD5.cpp:44
visionary::ChallengeRequest::salt
std::array< std::uint8_t, 16 > salt
Definition: AuthenticationSecure.h:22
visionary::AuthenticationSecure::m_protocolType
ProtocolType m_protocolType
Definition: AuthenticationSecure.h:39
visionary::SUL2
@ SUL2
Definition: AuthenticationSecure.h:17
visionary::AuthenticationSecure::m_VisionaryControl
VisionaryControl & m_VisionaryControl
Definition: AuthenticationSecure.h:38
visionary::AuthenticationSecure::~AuthenticationSecure
~AuthenticationSecure() override
visionary::AuthenticationSecure::loginImpl
bool loginImpl(UserLevel userLevel, const std::string &password, const CoLaParameterReader &getChallengeResponse, ProtocolType protocolType)
Definition: AuthenticationSecure.cpp:111
visionary::AuthenticationSecure::AuthenticationSecure
AuthenticationSecure(VisionaryControl &vctrl)
Definition: AuthenticationSecure.cpp:24
visionary::ChallengeResponse
std::array< std::uint8_t, 32 > ChallengeResponse
Definition: AuthenticationSecure.h:26
visionary::AuthenticationSecure::login
bool login(UserLevel userLevel, const std::string &password) override
Definition: AuthenticationSecure.cpp:160
visionary::AuthenticationSecure::CreateChallengeResponse
ChallengeResponse CreateChallengeResponse(UserLevel userLevel, const std::string &password, const ChallengeRequest &challengeRequest, ProtocolType protocolType)
Definition: AuthenticationSecure.cpp:93
visionary::PasswordHash
std::array< std::uint8_t, 32 > PasswordHash
Definition: AuthenticationSecure.h:25
visionary::IAuthentication
Definition: IAuthentication.h:11
visionary::ChallengeRequest::challenge
std::array< std::uint8_t, 16 > challenge
Definition: AuthenticationSecure.h:21
visionary::SUL1
@ SUL1
Definition: AuthenticationSecure.h:16
visionary::ChallengeRequest
Definition: AuthenticationSecure.h:19
visionary::AuthenticationSecure
Definition: AuthenticationSecure.h:28
CoLaParameterReader.h
visionary::UNKNOWN
@ UNKNOWN
Definition: AuthenticationSecure.h:15
visionary::VisionaryControl
Definition: VisionaryControl.h:19


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:36:38