forked from netty/netty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PemPrivateKey.toPem(...) should throw IllegalArgumentException when P… (
netty#8253) * PemPrivateKey.toPem(...) should throw IllegalArgumentException when PrivateKey which does not support encoding is used. Motivation: At the moment when a PrivateKey is used that does not support encoding we throw a NPE when trying to convert the key. We should better throw an IllegalArgumentException with the details about what key we tried to encode. Modifications: - Check if PrivateKey.getEncoded() returns null and if so throw an IllegalArgumentException - Add unit test. Result: Better handling of non-supported PrivateKey implementations.
- Loading branch information
1 parent
02d559e
commit 5ff6b57
Showing
2 changed files
with
29 additions
and
1 deletion.
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