    WindowsCryptProvider()
    {
        if (!CryptAcquireContext(&crypt_prov,
                                 "Container",
                                 NULL,
                                 PROV_RSA_FULL,
                                 0))
        {
#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \
     defined(__clang__))
#           pragma GCC diagnostic push
#           pragma GCC diagnostic ignored "-Wold-style-cast"
#           pragma GCC diagnostic ignored "-Wsign-compare"
#           pragma GCC diagnostic ignored "-Wsign-conversion"
#endif
            if (GetLastError() == NTE_BAD_KEYSET)
#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \
     defined(__clang__))
#           pragma GCC diagnostic pop
#endif
            {
                if (! CryptAcquireContext(&crypt_prov,
                                         "Container",
                                         NULL,
                                         PROV_RSA_FULL,
                                         CRYPT_NEWKEYSET))
                {
                    throw std::runtime_error(
                        "unable to acquire crypt context with new keyset");
                }
            }
            else
            {
                throw std::runtime_error("unable to acquire crypt context");
            }
        }
    }
    WindowsCryptProvider()
    {
        if (!CryptAcquireContext(&crypt_prov,
                                 "Container",
                                 NULL,
                                 PROV_RSA_FULL,
                                 0))
        {
#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \
     defined(__clang__))
#           pragma GCC diagnostic push
#           pragma GCC diagnostic ignored "-Wold-style-cast"
#           pragma GCC diagnostic ignored "-Wsign-compare"
#           pragma GCC diagnostic ignored "-Wsign-conversion"
#endif
            if (GetLastError() == NTE_BAD_KEYSET)
#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \
     defined(__clang__))
#           pragma GCC diagnostic pop
#endif
            {
                if (! CryptAcquireContext(&crypt_prov,
                                         "Container",
                                         NULL,
                                         PROV_RSA_FULL,
                                         CRYPT_NEWKEYSET))
                {
                    throw std::runtime_error(
                        "unable to acquire crypt context with new keyset");
                }
            }
            else
            {
                throw std::runtime_error("unable to acquire crypt context");
            }
        }
    }