diff options
author | Bartosz Przydatek <przydatek@google.com> | 2018-07-27 00:27:34 -0700 |
---|---|---|
committer | Charles Lee <ckl@google.com> | 2018-07-27 12:26:19 -0700 |
commit | f8ebc9fe9823e38971834343c4f7ea7f3ab860fc (patch) | |
tree | 3224728f7b56ed807bb1a242b26afef588ab603b /cc/key_manager.h | |
parent | ee005226a31a4e5084a6c292f1d6363b8a955ac6 (diff) | |
download | tink-f8ebc9fe9823e38971834343c4f7ea7f3ab860fc.tar.gz |
Adding C++ API to get public keys from private keys.
PiperOrigin-RevId: 206279840
GitOrigin-RevId: d77309c992f7328cb4ef4ad193e82d8d175003a4
Diffstat (limited to 'cc/key_manager.h')
-rw-r--r-- | cc/key_manager.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cc/key_manager.h b/cc/key_manager.h index 9afc67db9..0b49a455c 100644 --- a/cc/key_manager.h +++ b/cc/key_manager.h @@ -30,7 +30,7 @@ namespace crypto { namespace tink { -// An auxiliary container for methods that generate new key material. +// Auxiliary containers for methods that generate or extract key material. // These methods are grouped separately, as their functionality // is independent of the primitive of the corresponding KeyManager. class KeyFactory { @@ -54,6 +54,16 @@ class KeyFactory { virtual ~KeyFactory() {} }; +class PrivateKeyFactory : public KeyFactory { + public: + // Returns public key data extracted from the given serialized_private_key. + virtual + crypto::tink::util::StatusOr<std::unique_ptr<google::crypto::tink::KeyData>> + GetPublicKeyData(absl::string_view serialized_private_key) const = 0; + + virtual ~PrivateKeyFactory() {} +}; + /** * KeyManager "understands" keys of a specific key types: it can * generate keys of a supported type and create primitives for |