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

Function LoadRSAPrivateKeyFromDisk

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

Source from the content-addressed store, hash-verified

9)
10
11func LoadRSAPrivateKeyFromDisk(location string) *rsa.PrivateKey {
12 keyData, e := os.ReadFile(location)
13 if e != nil {
14 panic(e.Error())
15 }
16 key, e := jwt.ParseRSAPrivateKeyFromPEM(keyData)
17 if e != nil {
18 panic(e.Error())
19 }
20 return key
21}
22
23func LoadRSAPublicKeyFromDisk(location string) *rsa.PublicKey {
24 keyData, e := os.ReadFile(location)

Callers 3

initFunction · 0.92
makeTokenFunction · 0.92
TestParseRequestFunction · 0.92

Calls 1

ErrorMethod · 0.80

Tested by 3

initFunction · 0.74
makeTokenFunction · 0.74
TestParseRequestFunction · 0.74