aboutsummaryrefslogtreecommitdiff
path: root/cc/monitoring
diff options
context:
space:
mode:
authorwconner <wconner@google.com>2022-10-13 15:22:15 -0700
committerCopybara-Service <copybara-worker@google.com>2022-10-13 15:23:27 -0700
commit3380ad110bb063391ae1ced45f14a41844926e96 (patch)
treec5ff6d9532b8825fa8d2eccf232ab9ba3f9b324c /cc/monitoring
parente495ec976c37aecb4a83d9bbc95fc5ec51cc00ac (diff)
downloadtink-3380ad110bb063391ae1ced45f14a41844926e96.tar.gz
Make KeyStatus enum public and add conversion utility functions.
Also, update monitoring library to use moved enum and conversion utilities. PiperOrigin-RevId: 480997271
Diffstat (limited to 'cc/monitoring')
-rw-r--r--cc/monitoring/BUILD.bazel1
-rw-r--r--cc/monitoring/CMakeLists.txt1
-rw-r--r--cc/monitoring/monitoring.h11
3 files changed, 3 insertions, 10 deletions
diff --git a/cc/monitoring/BUILD.bazel b/cc/monitoring/BUILD.bazel
index 22d3886a0..f5b635644 100644
--- a/cc/monitoring/BUILD.bazel
+++ b/cc/monitoring/BUILD.bazel
@@ -7,6 +7,7 @@ cc_library(
hdrs = ["monitoring.h"],
include_prefix = "tink/monitoring",
deps = [
+ "//:key_status",
"//util:statusor",
"@com_google_absl//absl/container:flat_hash_map",
],
diff --git a/cc/monitoring/CMakeLists.txt b/cc/monitoring/CMakeLists.txt
index 961388547..9d395efad 100644
--- a/cc/monitoring/CMakeLists.txt
+++ b/cc/monitoring/CMakeLists.txt
@@ -6,6 +6,7 @@ tink_cc_library(
monitoring.h
DEPS
absl::flat_hash_map
+ tink::core::key_status
tink::util::statusor
)
diff --git a/cc/monitoring/monitoring.h b/cc/monitoring/monitoring.h
index e25e99a4e..54978658d 100644
--- a/cc/monitoring/monitoring.h
+++ b/cc/monitoring/monitoring.h
@@ -21,6 +21,7 @@
#include <vector>
#include "absl/container/flat_hash_map.h"
+#include "tink/key_status.h"
#include "tink/util/statusor.h"
namespace crypto {
@@ -33,16 +34,6 @@ class MonitoringKeySetInfo {
// Description about each entry of the KeySet.
class Entry {
public:
- // Enum representation of KeyStatusType in tink/proto/tink.proto. Using an
- // enum class prevents unintentional implicit conversions.
- enum class KeyStatus : int {
- kEnabled = 1, // Can be used for cryptographic operations.
- kDisabled = 2, // Cannot be used (but can become kEnabled again).
- kDestroyed = 3, // Key data does not exist in this Keyset any more.
- // Added to guard from failures that may be caused by future expansions.
- kDoNotUseInsteadUseDefaultWhenWritingSwitchStatements = 20,
- };
-
// Constructs a new KeySet entry with a given `status`, `key_id` and key
// format `parameters_as_string`.
Entry(KeyStatus status, uint32_t key_id,