lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Jun 03, 2016 at 04:33:55PM +1000, Daurnimator wrote:
> On 3 June 2016 at 16:13, Daurnimator <quae@daurnimator.com> wrote:
> > luaossl can. what issue(s) did you run into?
> 
> Actually if you're looking for functionality such as `openssl rsautl
> -oaep` luaossl doesn't currently have it.

What's missing is support for EVP_PKEY_encrypt. It one sense it should be
relatively easy to add as EVP_PKEY already has bindings. Though the
EVP_PKEY_encrypt API is different between 0.9.8 and 1.0+, and figuring out
how to integrate the newer EVP_PKEY_CTX API isn't obvious on it's face. It
may be as simple as just adding openssl.pkey:encrypt, which takes a few
positional parameters. As abstract as the EVP_PKEY_CTX API is, it might be
the case that there's only one or two operations (e.g. padding) on it
possible (now or in the future) in the context of public-key encryption and
decryption. Or it might not, in which case maybe openssl.pkey:encrypt returns a
new context object, like:

	local ctx = key:encrypt()
	ctx:setSomeParameter()
	ctx:setSomeOtherParameter()
	return ctx:final()