Erlang中文论坛

标题: 华为sha256算法 [打印本页]

作者: tianzhiwu    时间: 2022-8-17 16:31
标题: 华为sha256算法
rsa_sha256_sign(Content, PriKey) ->
    RSAPriKey = public_key:der_decode('PrivateKeyInfo', base64:decode(PriKey)),
    SignBin = public_key:sign(Content, sha256, RSAPriKey, [{rsa_padding, rsa_pkcs1_padding}]),
    Sign = base64:encode(SignBin),
    Sign.






欢迎光临 Erlang中文论坛 (https://bbs.erldoc.com/) Powered by Discuz! X3.3