fffonion / fffonion/lua-resty-openssl

sm2加密报错

オープン
#229 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Lua
スター
170
フォーク
52
PR マージ指標
30日以内にマージされた PR はありません

説明

使用type = "EC" 生成的公钥,在加密时报错,报错信息如下:
`pkey:asymmetric_routine EVP_PKEY_encrypt_init: code: -2 evp/pmeth_fn.c:141:error:0608B096:digital envelope routines: EVP_PKEY_encrypt_init: operation not supported for this keytype`

代码如下:
```lua
local pkey = require "resty.openssl.pkey"
local priv_key, err = pkey.new({
type = "EC"
})
local pub_pem = priv_key:to_PEM("public")
local pub_key, err = pkey.new(pub_pem)

local plaintext = "测试消息"
local ciphertext, err = pub_key:encrypt(plaintext)
if not ciphertext then
ngx.say(err)
end
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。