Commit Graph

18 Commits

Author SHA1 Message Date
Christian Banse b357385d3e
Moving `DecodeSegement` to `Parser` (#278)
* Moving `DecodeSegement` to `Parser`

This would allow us to remove some global variables and move them to parser options as well as potentially introduce interfaces for json and b64 encoding/decoding to replace the std lib, if someone wanted to do that for performance reasons.

We keep the functions exported because of explicit user demand.

* Sign/Verify does take the decoded form now
2023-03-24 19:13:09 +01:00
Michael Fridman 2ebb50f957
Adds go module support /v4 (#41)
Additionally, added `staticcheck` for basic static code analysis (#44)

Co-authored-by: Christian Banse <oxisto@aybaze.com>
2021-08-03 15:51:01 +02:00
Dave Grijalva 06ea103174 documentation around expected key types 2018-03-08 15:13:08 -08:00
Dave Grijalva 6fd0370e43 Merge branch 'master' of https://github.com/martinlindhe/jwt-go into patch_109 2016-06-07 10:34:06 -07:00
Martin Lindhe f7288992d2 split ErrInvalidKey into ErrInvalidType and ErrInvalidKey 2015-12-29 22:51:54 +01:00
Dave Grijalva 011d5bb935 drop support for []byte keys in RSA signing methods 2015-07-20 10:23:11 -07:00
Dave Grijalva 35c43501ff documentation 2014-08-26 15:30:37 -07:00
Dave Grijalva 2ef58916cc return an error if the requested hash method hasn't been compiled in 2014-08-26 15:00:15 -07:00
Dave Grijalva bcec7fbe47 documentation fix 2014-08-26 14:25:13 -07:00
Dave Grijalva 652b4be28c make helper methods more specific 2014-08-26 14:24:20 -07:00
Simon Jefford 1363e28b6a expose RSA key PEM parsing funcs 2014-08-26 14:21:38 -07:00
Simon Jefford 33523225e1 can now pass a PublicKey to SigningMethodRSA.Verify 2014-08-26 14:20:56 -07:00
Simon Jefford dc2f34cdb1 can now pass a PrivateKey to SigningMethodRSA.Sign
Conflicts:
	rsa.go
2014-08-26 14:20:28 -07:00
Dave Grijalva c9b532b51b cleanup and documentation updates 2014-08-26 14:18:59 -07:00
Simon Jefford 23cb3af02c pass keys as interface{} rather than []byte
This will allow clients to pass, for example, their own instances of
rsa.PublicKey if the key is not specified as some flavour of X509
cert. For example, Salesforce just specify the modulus and
exponent (https://login.salesforce.com/id/keys)
2014-08-26 14:14:17 -07:00
Dave Grijalva 358ed97e4b Merge branch 'wider' into two_point_oh 2014-08-26 13:45:08 -07:00
Dave Grijalva 629af62465 Added support for RS384 and RS512 signing methods
Renamed type SigningMethodRS256 to SigningMethodRSA
Added contstants SigningMethodRS256, SigningMethodRS384, and SigningMethodRS512 to support each of these methods
Added simple tests to support these new methods
2014-07-05 15:34:31 -07:00
Dave Grijalva 97430c0b8b cleaned up and flattened RS256 implementation 2014-07-05 15:25:29 -07:00