Tink sometimes produces error messages such as
No wrapper registered for type
No manager for type T has been registered
Unable to get primitive interface P for key of type T
This page helps to debug such issues.
Case 1: The error stars with "No wrapper found" or similar.
You are calling GetPrimitive()
to get a primitive type that has not been
registered, which is generally fixed by calling TinkConfig.register()
somewhere earlier in the binary. Registering once suffices and can be done at
startup.
Some primitives need more specialized registration.
KeysetDeriver
requiresKeyDerivationConfig.register()
JwtMac
requiresJwtMacConfig.register()
JwtPublicKeySign
andJwtPublicKeyVerify
requireJwtSignatureConfig.register()
Case 2: The error lists a key type and a primitive.
For example, the error might say Unable to get primitive interface P for key
of type T
for some specific value of P and T.
In this case, Tink is unable to create the specific primitive you asked it for the keyset you have. Typically, this happens because you have a keyset for the wrong type. For example, you might be asking for a Mac, but the keyset is for Aead.
One common case is that one tries to get a public key primitive from a keyset
containing private keys. To see if this is the problem, consider calling
GetPrimitive()
on the result of GetPublicKeysetHandle()
instead.
If this does not help, an up to date list of the key types can be found here, in our cross language tests. You should check if the primitive P is listed together with the key type T.
If the primitive is listed with the corresponding key type, it may be that the Tink implementation of your language does not support key type T. Check the list of key types to see if Tink supports your key type in your language.