<div dir="auto">Operations that a private key can do are decrypt and sign. Similarly, operations that a public key can do are encrypt and verify.<div dir="auto"><br></div><div dir="auto">The legacy priv_enc(raw) just refers to raw signing, and is almost same as sign(with proper padding mechanisms). </div><div dir="auto"><br></div><div dir="auto">It is just a misnomer, as data encrypted with a private key can be decrypted by everyone with the corresponding public key. It is actually a sign operation, that lets everyone verify the signature.</div><div dir="auto"><br></div><div dir="auto">Thanks,</div><div dir="auto">Thulasi.</div><div dir="auto"><div dir="auto"><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 8 Feb, 2020, 08:17 Rafael Ferrer, <<a href="mailto:eureka6676@gmail.com">eureka6676@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I implemented some custom engines and RSA_meth_set_priv_enc seems to map <br>
to other libraries' RSA decrypt operation (NCryptDecrypt ||||on Windows <br>
CNG, Cipher class with Cipher.DECRYPT_MODE on Android). They can do a <br>
TLS connection just fine with a self-signed cert.<br>
<br>
<br>
I looked at another custom engine and they seem to also use RSA decrypt for<br>
RSA_meth_set_priv_enc:<br>
<br>
<a href="https://github.com/tpm2-software/tpm2-tss-engine/blob/master/src/tpm2-tss-engine-rsa.c#L163" rel="noreferrer noreferrer" target="_blank">https://github.com/tpm2-software/tpm2-tss-engine/blob/master/src/tpm2-tss-engine-rsa.c#L163</a><br>
<br>
BoringSSL's (deprecated) rsa_meth_st only has a sign and a decrypt, <br>
having no encrypt operation:<br>
<br>
<a href="https://commondatastorage.googleapis.com/chromium-boringssl-docs/rsa.h.html#rsa_meth_st" rel="noreferrer noreferrer" target="_blank">https://commondatastorage.googleapis.com/chromium-boringssl-docs/rsa.h.html#rsa_meth_st</a><br>
<br>
<br>
Is this just a naming quirk? I want to put down the nagging feeling I <br>
have a bug somewhere.<br>
<br>
</blockquote></div>