Update SoftHSM v2.0 to the latest version
[aaf/sshsm.git] / SoftHSMv2 / modules / tests / test_botan_rfc5649.cpp
diff --git a/SoftHSMv2/modules/tests/test_botan_rfc5649.cpp b/SoftHSMv2/modules/tests/test_botan_rfc5649.cpp
new file mode 100644 (file)
index 0000000..7f1fae4
--- /dev/null
@@ -0,0 +1,19 @@
+#include <botan/botan.h>
+#include <botan/rfc3394.h>
+#include <botan/version.h>
+int main()
+{
+        using namespace Botan;
+
+#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,11,0)
+        secure_vector<byte> key(10);
+        SymmetricKey kek("AABB");
+        secure_vector<byte> x = rfc5649_keywrap(key, kek);
+#else
+        SecureVector<byte> key(10);
+        SymmetricKey kek("AABB");
+        Algorithm_Factory& af = global_state().algorithm_factory();
+        SecureVector<byte> x = rfc5649_keywrap(key, kek, af);
+#endif
+        return 0;
+}