aboutsummaryrefslogtreecommitdiff
path: root/cc/cleartext_keyset_handle.h
diff options
context:
space:
mode:
authorBartosz Przydatek <przydatek@google.com>2017-06-13 18:03:45 +0200
committerThai Duong <thaidn@google.com>2017-06-22 22:14:52 -0700
commit5181246a252f2ca8b5697e625838ad58ae76c0a3 (patch)
tree414783cbf5c97a30d982f49afe9dd8acd14b95eb /cc/cleartext_keyset_handle.h
parentda961095106c7ad6ca8656fb27dc07349c3308d7 (diff)
downloadtink-5181246a252f2ca8b5697e625838ad58ae76c0a3.tar.gz
Adding cross-language tests for hybrid encryption.
Change-Id: I15136873c1b4a00b27169084f354ffbd9a0c9a53 ORIGINAL_AUTHOR=Bartosz Przydatek <przydatek@google.com> GitOrigin-RevId: 47c154adf3389b287362fd4a2bde41acf5b53682
Diffstat (limited to 'cc/cleartext_keyset_handle.h')
-rw-r--r--cc/cleartext_keyset_handle.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/cc/cleartext_keyset_handle.h b/cc/cleartext_keyset_handle.h
new file mode 100644
index 000000000..aefce8bd6
--- /dev/null
+++ b/cc/cleartext_keyset_handle.h
@@ -0,0 +1,44 @@
+// Copyright 2017 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef TINK_CLEARTEXT_KEYSET_HANDLE_H_
+#define TINK_CLEARTEXT_KEYSET_HANDLE_H_
+
+#include <istream>
+#include <sstream>
+
+#include "cc/keyset_handle.h"
+#include "cc/util/statusor.h"
+
+namespace crypto {
+namespace tink {
+
+// Creates keyset handles from cleartext keysets. This API allows
+// loading cleartext keysets, thus its usage should be restricted.
+class CleartextKeysetHandle {
+ public:
+ static util::StatusOr<std::unique_ptr<KeysetHandle>> ParseFrom(
+ const std::string& serialized_keyset);
+ static util::StatusOr<std::unique_ptr<KeysetHandle>> ParseFrom(
+ std::istream* keyset_stream);
+ private:
+ CleartextKeysetHandle() {};
+};
+
+} // namespace tink
+} // namespace crypto
+
+#endif // TINK_CLEARTEXT_KEYSET_HANDLE_H_