| 1058 | static const unsigned BITS64 = sizeof(FB_UINT64) * 8u; |
| 1059 | |
| 1060 | class SpecificPlugins |
| 1061 | { |
| 1062 | public: |
| 1063 | SpecificPlugins(CryptKeyType& t) |
| 1064 | : knownType(t), n(0) |
| 1065 | { |
| 1066 | scan(); |
| 1067 | } |
| 1068 | |
| 1069 | bool hasData() |
| 1070 | { |
| 1071 | return n < knownType.plugins.getCount(); |
| 1072 | } |
| 1073 | |
| 1074 | const PathName& get() |
| 1075 | { |
| 1076 | if (hasData()) |
| 1077 | return knownType.plugins[n]; |
| 1078 | |
| 1079 | fb_assert(false); |
| 1080 | fatal_exception::raise("Error using CryptKeyTypeManager"); |
| 1081 | |
| 1082 | // compiler warning silencer |
| 1083 | return knownType.plugins[0]; |
| 1084 | } |
| 1085 | |
| 1086 | void next() |
| 1087 | { |
| 1088 | if (hasData()) |
| 1089 | { |
| 1090 | ++n; |
| 1091 | scan(); |
| 1092 | } |
| 1093 | } |
| 1094 | |
| 1095 | private: |
| 1096 | CryptKeyType& knownType; |
| 1097 | unsigned n; |
| 1098 | |
| 1099 | void scan() |
| 1100 | { |
| 1101 | while (hasData()) |
| 1102 | { |
| 1103 | if (knownType.hasSpecificData & (CryptKeyType::one << n)) |
| 1104 | break; |
| 1105 | ++n; |
| 1106 | } |
| 1107 | } |
| 1108 | }; |
| 1109 | |
| 1110 | private: |
| 1111 | class CryptKeyType : public PermanentStorage |