netty5/handler/src
Norman Maurer 5ff6b57940
PemPrivateKey.toPem(...) should throw IllegalArgumentException when P… (#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.
2018-09-05 20:33:40 +02:00
..
main/java/io/netty/handler PemPrivateKey.toPem(...) should throw IllegalArgumentException when P… (#8253) 2018-09-05 20:33:40 +02:00
test PemPrivateKey.toPem(...) should throw IllegalArgumentException when P… (#8253) 2018-09-05 20:33:40 +02:00