diff options
author | Shawn Willden <swillden@google.com> | 2015-05-12 06:57:37 -0600 |
---|---|---|
committer | Shawn Willden <swillden@google.com> | 2015-05-18 10:21:10 -0600 |
commit | f923963fda888eac9e7997b71d5525ea2f82a091 (patch) | |
tree | cd71086d18f6eb1ffc47d7f8cc3d92346ba639c6 /hmac_key.cpp | |
parent | eaca59e402805f67caa0766bf9881e294cb28821 (diff) | |
download | keymaster-f923963fda888eac9e7997b71d5525ea2f82a091.tar.gz |
Move key factory registration into SoftKeymasterDevice.
So we can do it differently in the keymaster0 adapter.
Bug: 20912868
Change-Id: If4c602cc0fab3e59cd2e395a97e21dd8cb3a176f
Diffstat (limited to 'hmac_key.cpp')
-rw-r--r-- | hmac_key.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/hmac_key.cpp b/hmac_key.cpp index 0f43640..294832d 100644 --- a/hmac_key.cpp +++ b/hmac_key.cpp @@ -23,17 +23,12 @@ namespace keymaster { -class HmacKeyFactory : public SymmetricKeyFactory { - public: - keymaster_algorithm_t registry_key() const { return KM_ALGORITHM_HMAC; } +Key* HmacKeyFactory::LoadKey(const UnencryptedKeyBlob& blob, keymaster_error_t* error) { + return new HmacKey(blob, error); +} - virtual Key* LoadKey(const UnencryptedKeyBlob& blob, keymaster_error_t* error) { - return new HmacKey(blob, error); - } - - virtual SymmetricKey* CreateKey(const AuthorizationSet& auths) { return new HmacKey(auths); } -}; - -static KeyFactoryRegistry::Registration<HmacKeyFactory> registration; +SymmetricKey* HmacKeyFactory::CreateKey(const AuthorizationSet& auths) { + return new HmacKey(auths); +} } // namespace keymaster |