MCPcopy
hub / github.com/golang-jwt/jwt / LoadRSAPublicKeyFromDisk

Function LoadRSAPublicKeyFromDisk

test/helpers.go:23–33  ·  view source on GitHub ↗
(location string)

Source from the content-addressed store, hash-verified

21}
22
23func LoadRSAPublicKeyFromDisk(location string) *rsa.PublicKey {
24 keyData, e := os.ReadFile(location)
25 if e != nil {
26 panic(e.Error())
27 }
28 key, e := jwt.ParseRSAPublicKeyFromPEM(keyData)
29 if e != nil {
30 panic(e.Error())
31 }
32 return key
33}
34
35// MakeSampleToken creates and returns a encoded JWT token that has been signed with the specified cryptographic key.
36func MakeSampleToken(c jwt.Claims, method jwt.SigningMethod, key any) string {

Callers 3

initFunction · 0.92
verifyFunction · 0.92
TestParseRequestFunction · 0.92

Calls 1

ErrorMethod · 0.80

Tested by 3

initFunction · 0.74
verifyFunction · 0.74
TestParseRequestFunction · 0.74