49 typedef std::function<std::string(std::string)>
pin_cb;
56 void gen_random(uint8_t out[],
size_t out_len);
59 void stir_random(const uint8_t in[],
size_t in_len);
61 std::
string get_user_pin(const std::
string& who) {
return m_pin_cb(who); }
63 uint32_t current_counter();
65 TSS_HCONTEXT
handle()
const {
return m_ctx; }
67 TSS_HKEY
srk()
const {
return m_srk; }
70 std::function<std::string(std::string)> m_pin_cb;
74 TSS_HPOLICY m_srk_policy;
136 std::unique_ptr<Public_Key> public_key()
const override;
138 std::vector<uint8_t> export_blob()
const;
142 TSS_HKEY
handle()
const {
return m_key; }
147 static std::vector<std::string> registered_keys(
TPM_Context& ctx);
149 size_t estimated_strength()
const override;
151 size_t key_length()
const override;
155 std::vector<uint8_t> public_key_bits()
const override;
157 std::vector<uint8_t> raw_public_key_bits()
const override;
167 std::string
algo_name()
const override {
return "RSA"; }
170 throw Not_Implemented(
"Cannot generate a new TPM-based keypair from this asymmetric key");
176 std::string_view params,
177 std::string_view provider)
const override;
TSS_HCONTEXT handle() const
std::function< std::string(std::string)> pin_cb