Debug degli errori di registrazione
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Tink a volte genera messaggi di errore come
No wrapper registered for type
No manager for type T has been registered
Unable to get primitive interface P for key of type T
Questa pagina consente di eseguire il debug di questi problemi.
Caso 1: l'errore contrassegnato come "Nessun wrapper trovato" o simile.
Stai chiamando GetPrimitive()
per ottenere un tipo primitivo che non è stato
registrato, che in genere è risolto chiamando TinkConfig.register()
in un punto precedente del file binario. La registrazione è sufficiente
e può essere eseguita all'avvio.
Alcune primitive richiedono una registrazione più specializzata.
KeysetDeriver
richiede KeyDerivationConfig.register()
JwtMac
richiede JwtMacConfig.register()
JwtPublicKeySign
e JwtPublicKeyVerify
richiedono
JwtSignatureConfig.register()
Caso 2: l'errore elenca un tipo di chiave e una primitiva.
Ad esempio, l'errore potrebbe indicare Unable to get primitive interface P for key
of type T
per un valore specifico di P e T.
In questo caso, Tink non è in grado di creare la primitiva specifica richiesta per il tuo set di chiavi. In genere, questo accade perché hai
un set di chiavi per il tipo sbagliato. Ad esempio, è possibile che ti serva un Mac, ma il set di tasti
è per Aead.
Un caso comune è il tentativo di ottenere una primitiva di chiave pubblica da un set di chiavi contenente chiavi private. Per verificare se il problema è questo, valuta la possibilità di chiamare
GetPrimitive()
dal risultato di GetPublicKeysetHandle()
.
Se il problema persiste, puoi trovare un elenco aggiornato dei tipi di chiavi qui, nei nostri test multilingue. Devi controllare se la P primitiva
è elencata insieme al tipo di chiave T.
Se la primitiva è elencata con il tipo di chiave corrispondente, è possibile che l'implementazione di Tink nel tuo linguaggio non supporti il tipo di chiave T. Controlla l'elenco dei tipi di chiave per vedere se Tink supporta il tipo di chiave nella tua lingua.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-25 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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."]]