-
Notifications
You must be signed in to change notification settings - Fork 151
Add toDerBytes
to SSLPrivateKey
#540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/// While generally speaking type-erasure has some nasty performance problems, we only need the type-erasure for | ||
/// Hashable conformance, which we don't use in any production code: only the tests use it. To that end, we don't | ||
/// mind too much that we need to do this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified this comment because I don't think this is true anymore: we are using the type-erased version in NIOSSLPrivateKey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thanks @gjcairo.
This PR adds new API (
SSLPrivateKey/toDerBytes()
) to get the DER bytes for a private key.This is only supported for native (EVP) keys; if using a custom key, an empty array of bytes will be returned instead.