aidantwoods / go-paseto

Platform-Agnostic Security Tokens implementation in Golang.
https://pkg.go.dev/aidanwoods.dev/go-paseto
MIT License
307 stars 17 forks source link

bad signature found #31

Closed faisal-porag closed 1 year ago

faisal-porag commented 1 year ago

parser := paseto.NewParser() publicKey, err := paseto.NewV4AsymmetricPublicKeyFromHex(config.PAccessKey) if err != nil { fmt.Println(err) // panic or deal with error of invalid key }

parsedToken, err := parser.ParseV4Public(publicKey, token, nil)
if err != nil {
    fmt.Println(err, "parsed error") // deal with error of token which failed to be validated, or cryptographically verified
}

this err show me bad signature. but why??

aidantwoods commented 1 year ago

Could you give an example of how you generated the token, imported/generated keys etc...?

faisal-porag commented 1 year ago

v4.public.eyJhY2Nlc3NfdXVpZCI6IjEyMWRmNmNiLWM1ZGQtNGFhOC05MGIyLWVhMTk4OGY5NTMyMyIsImF1dGhvcml6ZWQiOiJ0cnVlIiwiZXhwIjoiMjAyMy0wNC0xMFQxOToyODoxNiswNjowMCIsInVzZXJfaWQiOiIzOSJ9syp0sEB11Qs6SPSIPh5m0eufmBmxH3JvMCmS45OeJG0ypGrmJAju_cnIc1pF0d00yjKJ98V_9zMLlYdk8GioDQ

aidantwoods commented 1 year ago

I was looking more for the code you used to generate the token 🙂