Skip to content

Commit 5681091

Browse files
committed
Add MustParseRsaPublicKey function for parsing PEM formatted public keys
1 parent dec684b commit 5681091

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

utilities/utilities.go

+2
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ func ParseRsaPublicKey(key string) (*rsa.PublicKey, error) {
155155
return parsedKey.(*rsa.PublicKey), nil
156156
}
157157

158+
// MustParseRsaPublicKey parses a public key in PEM format and returns the rsa.PublicKey object.
159+
// Panics if the key is invalid.
158160
func MustParseRsaPublicKey(key string) *rsa.PublicKey {
159161
parsedKey, err := ParseRsaPublicKey(key)
160162
if err != nil {

0 commit comments

Comments
 (0)