Open pr0x1ma-byte opened 5 months ago
Hi @pr0x1ma-byte the alert log you are seeing indicating there's a uncleared error when doing pubkey:decrypt, but I don't seem to reproduce this using the following code:
local jwk = require("cjson").encode({
kty = "RSA",
n = "pjdss8ZaDfEH6K6U7GeW2nxDqR4IP049fk1fK0lndimbMMVBdPv_hSpm8T8EtBDxrUdi1OHZfMhUixGaut-3nQ4GG9nM249oxhCtxqqNvEXrmQRGqczyLxuh-fKn9Fg--hS9UpazHpfVAFnB5aCfXoNhPuI8oByyFKMKaOVgHNqP5NBEqabiLftZD3W_lsFCPGuzr4Vp0YS7zS2hDYScC2oOMu4rGU1LcMZf39p3153Cq7bS2Xh6Y-vw5pwzFYZdjQxDn8x8BG3fJ6j8TGLXQsbKH1218_HcUJRvMwdpbUQG5nvA2GXVqLqdwp054Lzk9_B_f1lVrmOKuHjTNHq48w",
e = "AQAB",
})
local key = assert(require("resty.openssl.pkey").new(jwk, {format = "JWK"}))
local err = require("resty.openssl.err")
print(err.format_error("x"))
print(key:decrypt("x"))
local pem = assert(key:to_PEM("public",false))
print(err.format_error("x"))
could you share more about the code that you use that involves pubkey decrypt operations?
I receive the following error when constructing a public key from an exponent and modulus:
This is how I'm constructing the key:
After a bit I get an alert in my nginx log with the error from above.