#ifndef CHROMECAST_CRYPTO_SIGNATURE_CACHE_H_
#define CHROMECAST_CRYPTO_SIGNATURE_CACHE_H_
#include <string>
#include "base/containers/lru_cache.h"
#include "base/synchronization/lock.h"
namespace chromecast {
class SignatureCache {
public:
SignatureCache();
SignatureCache(const SignatureCache&) = delete;
SignatureCache& operator=(const SignatureCache&) = delete;
~SignatureCache();
std::string Get(const std::string& wrapped_private_key,
const std::string& hash);
void Put(const std::string& wrapped_private_key,
const std::string& hash,
const std::string& signature);
private:
std::string key_;
base::Lock lock_;
base::HashingLRUCache<std::string, std::string> contents_;
};
}
#endif