Déboguer les erreurs d'enregistrement
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Tink génère parfois des messages d'erreur tels que :
No wrapper registered for type
No manager for type T has been registered
Unable to get primitive interface P for key of type T
Cette page vous aide à résoudre ces problèmes.
Cas 1: le message d'erreur indique "Aucun wrapper trouvé" (ou similaire).
Vous appelez GetPrimitive()
pour obtenir un type primitif qui n'a pas été enregistré, ce qui est généralement corrigé en appelant TinkConfig.register()
plus tôt dans le binaire. S'inscrire une fois suffit et peut être effectué au démarrage.
Certaines primitives nécessitent un enregistrement plus spécialisé.
KeysetDeriver
requiert KeyDerivationConfig.register()
JwtMac
requiert JwtMacConfig.register()
JwtPublicKeySign
et JwtPublicKeyVerify
nécessitent JwtSignatureConfig.register()
Cas 2: l'erreur indique un type de clé et une primitive.
Par exemple, l'erreur peut indiquer Unable to get primitive interface P for key
of type T
pour une valeur spécifique de P et T.
Dans ce cas, Tink ne peut pas créer la primitive spécifique que vous lui avez demandée pour votre collection de clés. En général, cela se produit lorsque vous disposez d'une collection de clés pour le mauvais type. Par exemple, vous demandez un Mac, mais la collection de clés est pour Aead.
Un cas courant est que l'on tente d'obtenir une primitive de clé publique à partir d'une collection de clés contenant des clés privées. Pour voir si c'est le problème à l'origine du problème, envisagez plutôt d'appeler GetPrimitive()
sur le résultat de GetPublicKeysetHandle()
.
Si cela ne résout pas le problème, une liste à jour des types de clés est disponible sur cette page, dans nos tests multilingues. Vous devez vérifier si la primitive P est répertoriée avec le type de clé T.
Si la primitive est répertoriée avec le type de clé correspondant, il est possible que l'implémentation Tink de votre langage ne soit pas compatible avec le type de clé T. Consultez la liste des types de clés pour savoir si Tink accepte ce type de clé dans votre langue.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/25 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/07/25 (UTC)."],[[["\u003cp\u003eTink error messages like "No wrapper registered" often indicate missing primitive registration, fixable with \u003ccode\u003eTinkConfig.register()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eErrors mentioning key type and primitive usually mean an incompatible keyset is used, like requesting a Mac with an Aead keyset.\u003c/p\u003e\n"],["\u003cp\u003ePublic key primitives require keysets obtained via \u003ccode\u003eGetPublicKeysetHandle()\u003c/code\u003e to avoid key type mismatches.\u003c/p\u003e\n"],["\u003cp\u003eVerify key type and primitive compatibility by checking the cross-language test resources and supported key types documentation for your language.\u003c/p\u003e\n"]]],["Tink error messages like \"No wrapper registered\" or \"Unable to get primitive\" indicate issues with key and primitive type registration or compatibility. For \"No wrapper\" errors, register the type using `TinkConfig.register()` or specialized methods like `KeyDerivationConfig.register()`. For primitive-key type mismatches, verify that the keyset's type matches the requested primitive, and use `GetPublicKeysetHandle()` for public keys. Check supported key type lists if registration or type-checking does not fix the issue.\n"],null,["# Debug Registration Errors\n\nTink sometimes produces error messages such as\n\n- `No wrapper registered for type`\n- `No manager for type T has been registered`\n- `Unable to get primitive interface P for key of type T`\n\nThis page helps to debug such issues.\n\nCase 1: The error stars with \"No wrapper found\" or similar.\n-----------------------------------------------------------\n\nYou are calling `GetPrimitive()` to get a primitive type that has not been\nregistered, which is generally fixed by calling `TinkConfig.register()`\nsomewhere earlier in the binary. Registering once suffices and can be done at\nstartup.\n\nSome primitives need more specialized registration.\n\n- `KeysetDeriver` requires `KeyDerivationConfig.register()`\n- `JwtMac` requires `JwtMacConfig.register()`\n- `JwtPublicKeySign` and `JwtPublicKeyVerify` require `JwtSignatureConfig.register()`\n\nCase 2: The error lists a key type and a primitive.\n---------------------------------------------------\n\nFor example, the error might say `Unable to get primitive interface P for key\nof type T` for some specific value of P and T.\n\nIn this case, Tink is unable to create the specific primitive you asked it\nfor the keyset you have. Typically, this happens because you have a keyset\nfor the wrong type. For example, you might be asking for a Mac, but the keyset\nis for Aead.\n\nOne common case is that one tries to get a public key primitive from a keyset\ncontaining private keys. To see if this is the problem, consider calling\n`GetPrimitive()` on the result of `GetPublicKeysetHandle()` instead.\n\nIf this does not help, an up to date list of the key types can be found\n[here](https://github.com/tink-crypto/tink-cross-lang-tests/blob/main/cross_language/cross_language/tink_config/_key_types.py),\nin our [cross language tests](https://github.com/tink-crypto/tink-cross-lang-tests/blob/main/cross_language/cross_language). You should check if the primitive P is listed\ntogether with the key type T.\n\nIf the primitive is listed with the corresponding key type, it may be that\nthe Tink implementation of your language does not support key type T. Check the\n[list of key types](/tink/supported-key-types) to see if Tink supports your key\ntype in your language."]]