(t *testing.T)
| 84 | } |
| 85 | |
| 86 | func TestRSAVerifyWithPreParsedPrivateKey(t *testing.T) { |
| 87 | key, _ := os.ReadFile("test/sample_key.pub") |
| 88 | parsedKey, err := jwt.ParseRSAPublicKeyFromPEM(key) |
| 89 | if err != nil { |
| 90 | t.Fatal(err) |
| 91 | } |
| 92 | testData := rsaTestData[0] |
| 93 | parts := strings.Split(testData.tokenString, ".") |
| 94 | err = jwt.SigningMethodRS256.Verify(strings.Join(parts[0:2], "."), decodeSegment(t, parts[2]), parsedKey) |
| 95 | if err != nil { |
| 96 | t.Errorf("[%v] Error while verifying key: %v", testData.name, err) |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | func TestRSAWithPreParsedPrivateKey(t *testing.T) { |
| 101 | key, _ := os.ReadFile("test/sample_key") |
nothing calls this directly
no test coverage detected