aboutsummaryrefslogtreecommitdiff
path: root/cc/cleartext_keyset_handle.h
diff options
context:
space:
mode:
authorBartosz Przydatek <przydatek@google.com>2017-10-03 19:29:41 +0200
committerThai Duong <thaidn@google.com>2017-10-14 07:43:56 -0700
commit9fb561332176a9163e35453932c4751c32ab4e60 (patch)
tree6f2691af50d500981e6175526286ac65fdd7dff1 /cc/cleartext_keyset_handle.h
parent3e4c19bd2bc03d572e1752bcec1885aae9a33598 (diff)
downloadtink-9fb561332176a9163e35453932c4751c32ab4e60.tar.gz
Adding C++ KeysetReader.
Change-Id: I33c2a09d2983cd5aee28a1eec886eb22e31bf9f9 ORIGINAL_AUTHOR=Bartosz Przydatek <przydatek@google.com> GitOrigin-RevId: e6763b4edc0b874dec4e7056bd124271eeca9f2d
Diffstat (limited to 'cc/cleartext_keyset_handle.h')
-rw-r--r--cc/cleartext_keyset_handle.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/cc/cleartext_keyset_handle.h b/cc/cleartext_keyset_handle.h
index 17d95fda6..8beda9e00 100644
--- a/cc/cleartext_keyset_handle.h
+++ b/cc/cleartext_keyset_handle.h
@@ -21,6 +21,7 @@
#include <sstream>
#include "cc/keyset_handle.h"
+#include "cc/keyset_reader.h"
#include "cc/util/statusor.h"
#include "proto/tink.pb.h"
@@ -31,12 +32,10 @@ namespace tink {
// loading cleartext keysets, thus its usage should be restricted.
class CleartextKeysetHandle {
public:
- static crypto::tink::util::StatusOr<std::unique_ptr<KeysetHandle>> New(
- const google::crypto::tink::Keyset& keyset);
- static crypto::tink::util::StatusOr<std::unique_ptr<KeysetHandle>> ParseFrom(
- const std::string& serialized_keyset);
- static crypto::tink::util::StatusOr<std::unique_ptr<KeysetHandle>> ParseFrom(
- std::istream* keyset_stream);
+ // Creates a KeysetHandle with a keyset obtained via |reader|.
+ static crypto::tink::util::StatusOr<std::unique_ptr<KeysetHandle>> Read(
+ std::unique_ptr<KeysetReader> reader);
+
private:
CleartextKeysetHandle() {}
};