-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: switch to PKCS8 for private key parsing and handling
- Add `github.com/youmark/pkcs8` import for handling PKCS8 private keys - Initialize `err` variable before reading the private key file - Separate the declaration and assignment of `filecontent` when reading the private key file - Replace `jwt.ParseRSAPrivateKeyFromPEMWithPassword` with `pkcs8.ParsePKCS8PrivateKey` for parsing private keys - Add type assertion to check if the parsed key is of type `*rsa.PrivateKey` - Return `ErrInvalidPrivKey` if the parsed key is not of type `*rsa.PrivateKey` - Update `go.mod` to include `github.com/youmark/pkcs8` dependency Signed-off-by: appleboy <[email protected]>
- Loading branch information
Showing
3 changed files
with
16 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters