-BOOST_AUTO_TEST_CASE(gstore)
-{
- GStoreTest store(static_cast<CryptoBackend>(0));
-
- BOOST_REQUIRE_THROW(store.getObject(Token(), Password()),
- Exc::Crypto::OperationNotSupported);
- BOOST_REQUIRE_THROW(store.generateAKey(CryptoAlgorithm(), Password(), Password()),
- Exc::Crypto::OperationNotSupported);
- BOOST_REQUIRE_THROW(store.generateSKey(CryptoAlgorithm(), Password()),
- Exc::Crypto::OperationNotSupported);
- BOOST_REQUIRE_THROW(store.import(Crypto::Data(), Password(), Crypto::EncryptionParams()),
- Exc::Crypto::OperationNotSupported);
- BOOST_REQUIRE_THROW(store.destroy(Token()),
- Exc::Crypto::OperationNotSupported);
-}
-
-#if 0
-BOOST_AUTO_TEST_CASE(algo_validation_not_mandatory)
-{
- constexpr ParamName pn = ParamName::ALGO_TYPE;
- using Checker = Crypto::ParamCheck<
- pn, int, false, Crypto::Type<int>::Equals<0, 1, 2, 3, 4>,
- Crypto::DefaultGetter<int>>;
-
- Checker checker;
- CryptoAlgorithm ca;
-
- BOOST_REQUIRE_NO_THROW(checker.Check(ca));
-
- for (int i = 0; i < 5; ++i) {
- ca.setParam(pn, i);
- BOOST_REQUIRE_NO_THROW(checker.Check(ca));
- }
-
- for (int i = 5; i < 10; ++i) {
- ca.setParam(pn, i);
- BOOST_REQUIRE_THROW(checker.Check(ca), Exc::Crypto::InputParam);
- }
-}
-
-BOOST_AUTO_TEST_CASE(algo_validation_mandatory)
-{
- constexpr ParamName pn = ParamName::ALGO_TYPE;
- using Checker = Crypto::ParamCheck<
- pn, int, true, Crypto::Type<int>::Equals<0, 1, 2, 3, 4>,
- Crypto::DefaultGetter<int>>;
-
- Checker checker;
- CryptoAlgorithm ca;
-
- BOOST_REQUIRE_THROW(checker.Check(ca), Exc::Crypto::InputParam);
-
- for (int i = 0; i < 5; ++i) {
- ca.setParam(pn, i);
- BOOST_REQUIRE_NO_THROW(checker.Check(ca));
- }
-
- for (int i = 5; i < 10; ++i) {
- ca.setParam(pn, i);
- BOOST_REQUIRE_THROW(checker.Check(ca), Exc::Crypto::InputParam);
- }
-}
-
-BOOST_AUTO_TEST_CASE(algo_validation_throwing_handler)
-{
- constexpr ParamName pn = ParamName::ALGO_TYPE;
- using Checker = Crypto::ParamCheck<
- pn, int, true, Crypto::Type<int>::Equals<0, 1, 2, 3, 4>,
- Crypto::DefaultGetter<int>, ThrowingHandlerTest>;
-
- Checker checker;
- CryptoAlgorithm ca;
- BOOST_REQUIRE_THROW(checker.Check(ca), TestException);
-
- for (int i = 0; i < 5; ++i) {
- ca.setParam(pn, i);
- BOOST_REQUIRE_NO_THROW(checker.Check(ca));
- }
-
- for (int i = 5; i < 10; ++i) {
- ca.setParam(pn, i);
- BOOST_REQUIRE_THROW(checker.Check(ca), TestException);
- }
-}
-#endif
-