Created
May 16, 2021 19:10
-
-
Save brandonweeks/e6ce641298698f91fb4fac1f84505cdd to your computer and use it in GitHub Desktop.
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
// Find the type (e.g. RSA) of the EVP_PKEY we've been provided. | |
let pkey_type = EVP_PKEY_type(EVP_PKEY_id(pkey)); | |
// Create a new EVP_PKEY_METHOD. | |
let pmeth = EVP_PKEY_meth_new(pkey_type, 0); | |
// Find the default EVP_PKEY_METHOD for the type. | |
let default_method = EVP_PKEY_meth_find(pkey_type); | |
// Copy the default method into ours. | |
EVP_PKEY_meth_copy(pmeth, default_method); | |
// Overwrite _just_ the {sign_init, sign} methods. | |
EVP_PKEY_meth_set_sign(pmeth, sign_init, sign); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment