forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
authenticator_get_info_response.h
69 lines (57 loc) · 2.59 KB
/
authenticator_get_info_response.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef DEVICE_FIDO_AUTHENTICATOR_GET_INFO_RESPONSE_H_
#define DEVICE_FIDO_AUTHENTICATOR_GET_INFO_RESPONSE_H_
#include <stdint.h>
#include <string>
#include <vector>
#include "base/macros.h"
#include "base/optional.h"
#include "device/fido/authenticator_supported_options.h"
#include "device/fido/ctap_constants.h"
namespace device {
// Authenticator response for AuthenticatorGetInfo request that encapsulates
// versions, options, AAGUID(Authenticator Attestation GUID), other
// authenticator device information.
// https://fidoalliance.org/specs/fido-v2.0-rd-20170927/fido-client-to-authenticator-protocol-v2.0-rd-20170927.html#authenticatorGetInfo
class AuthenticatorGetInfoResponse {
public:
AuthenticatorGetInfoResponse(CtapDeviceResponseCode response_code,
std::vector<std::string> versions,
std::vector<uint8_t> aaguid);
AuthenticatorGetInfoResponse(AuthenticatorGetInfoResponse&& that);
AuthenticatorGetInfoResponse& operator=(AuthenticatorGetInfoResponse&& other);
~AuthenticatorGetInfoResponse();
AuthenticatorGetInfoResponse& SetMaxMsgSize(uint8_t max_msg_size);
AuthenticatorGetInfoResponse& SetPinProtocols(
std::vector<uint8_t> pin_protocols);
AuthenticatorGetInfoResponse& SetExtensions(
std::vector<std::string> extensions);
AuthenticatorGetInfoResponse& SetOptions(
AuthenticatorSupportedOptions options);
CtapDeviceResponseCode response_code() const { return response_code_; }
const std::vector<std::string>& versions() { return versions_; }
const std::vector<uint8_t>& aaguid() const { return aaguid_; }
const base::Optional<uint8_t>& max_msg_size() const { return max_msg_size_; }
const base::Optional<std::vector<uint8_t>>& pin_protocol() const {
return pin_protocols_;
}
const base::Optional<std::vector<std::string>>& extensions() const {
return extensions_;
}
const base::Optional<AuthenticatorSupportedOptions>& options() const {
return options_;
}
private:
CtapDeviceResponseCode response_code_;
std::vector<std::string> versions_;
std::vector<uint8_t> aaguid_;
base::Optional<uint8_t> max_msg_size_;
base::Optional<std::vector<uint8_t>> pin_protocols_;
base::Optional<std::vector<std::string>> extensions_;
base::Optional<AuthenticatorSupportedOptions> options_;
DISALLOW_COPY_AND_ASSIGN(AuthenticatorGetInfoResponse);
};
} // namespace device
#endif // DEVICE_FIDO_AUTHENTICATOR_GET_INFO_RESPONSE_H_