aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/base/scan_name.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/base/scan_name.h')
-rw-r--r--src/lib/base/scan_name.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/lib/base/scan_name.h b/src/lib/base/scan_name.h
index 75f7d1089..981d54765 100644
--- a/src/lib/base/scan_name.h
+++ b/src/lib/base/scan_name.h
@@ -8,7 +8,7 @@
#ifndef BOTAN_SCAN_NAME_H__
#define BOTAN_SCAN_NAME_H__
-#include <botan/types.h>
+#include <botan/exceptn.h>
#include <string>
#include <vector>
#include <botan/mutex.h>
@@ -126,6 +126,23 @@ class BOTAN_DLL SCAN_Name
std::vector<std::string> m_mode_info;
};
+// This is unrelated but it is convenient to stash it here
+template<typename T>
+std::vector<std::string> probe_providers_of(const std::string& algo_spec,
+ const std::vector<std::string>& possible)
+ {
+ std::vector<std::string> providers;
+ for(auto&& prov : possible)
+ {
+ std::unique_ptr<T> o(T::create(algo_spec, prov));
+ if(o)
+ {
+ providers.push_back(prov); // available
+ }
+ }
+ return providers;
+ }
+
}
#endif