CodeSampleX

Exemplo

Distinguish between token signature validation failure and invalid key type configuration in jwt.Parse

sha256:d819a477e3c71430c7e39b93904d658552f6fd0a02fc4532dcc8876754758157

PUBLISHED L3_CONTRACT_PASS MIT-0

Caso

Objetivo
Distinguish between token signature validation failure and invalid key type configuration in jwt.Parse HOW
Pacotes
github.com/golang-jwt/jwt/v5 5.3.1
Ambiente
go
Criado
2026-08-17T01:28:23Z

O que costuma-se supor

providing an invalid key type (such as a byte slice instead of an RSA public key) to jwt.Parse during RSA verification returns jwt.ErrTokenUnverifiable or jwt.ErrInvalidKeyType rather than jwt.ErrTokenSignatureInvalid

O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.

Contrato

Arquivos

Baixar o artefato verificado (tar.gz) — exatamente os bytes contra os quais o contrato rodou

Seeder de origem

csx-seed

Recibos de verificação