Skip to content

Commit d9348ca

Browse files
dido18lucarin91
andauthored
Update utilities/utilities.go
Co-authored-by: Luca Rinaldi <[email protected]>
1 parent 0f7a4fb commit d9348ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

utilities/utilities.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ func ParseRsaPublicKey(key []byte) (*rsa.PublicKey, error) {
152152
return nil, err
153153
}
154154

155-
return parsedKey.(*rsa.PublicKey), nil
155+
publicKey, ok := value.(*rsa.PublicKey)
156+
if !ok {
157+
return nil,fmt.Errorf("not an rsa key")
158+
}
159+
return publicKey, nil
156160
}
157161

158162
// MustParseRsaPublicKey parses a public key in PEM format and returns the rsa.PublicKey object.

0 commit comments

Comments
 (0)