/* * Extract an unencrypted private key and return it */ Private_Key* load_key(const std::string& fsname, RandomNumberGenerator& rng) { DataSource_Stream source(fsname, true); return load_key(source, rng, []() -> std::string { throw PKCS8_Exception( "Internal error: Attempt to read password for unencrypted key" );}, false); }
/* * Extract an unencrypted private key and return it */ std::unique_ptr<Private_Key> load_key(DataSource& source) { auto fail_fn = []() -> std::string { throw PKCS8_Exception("Internal error: Attempt to read password for unencrypted key"); }; return load_key(source, fail_fn, false); }