Add the primitives as template parameter to the InternalKeyMananger.
Unfortunately, without a change, it is impossible to use the InternalKeyManager in the registry. The reason is that there is no place where the previous code [1] can be instantiated in the registry (i.e., I cannot write any code which calls [1] in the registry). In the (to be written) function RegisterInternalKeyManager(...) I cannot call the code at [1] because it's impossible to know the primitive type for which to call it. In GetPrimitive<P> it is impossible because it's impossible to have the KeyProto type. The only option is to call it in the constructor of http://google3/third_party/tink/cc/core/internal_key_manager.h?l=82-89&rcl=244821003. But that would mean that we have to change the interface of InternalKeyMananger (i.e., add something like a function StatusOr<shared_ptr<void*>> Create(string_view serialized_key, std::type_index type), which I think is very complicated to understand). PiperOrigin-RevId: 246273708
Loading
Please register or sign in to comment