diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-06-01 20:28:24 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-06-01 20:39:04 +0200 |
commit | 5cffb7179fee6d70d5c8cee5b5c18ec51f1272f6 (patch) | |
tree | 9ed26ffd6cfd3d0e1dadfb83322e10b5eca04fce /doc/ja | |
parent | 6ac6cf729329559fa80ece1c057cb56fac81ff30 (diff) | |
download | weechat-5cffb7179fee6d70d5c8cee5b5c18ec51f1272f6.zip |
api: add function crypto_hmac (issue #1628)
Diffstat (limited to 'doc/ja')
-rw-r--r-- | doc/ja/weechat_plugin_api.ja.adoc | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc index b88949e48..ea645d493 100644 --- a/doc/ja/weechat_plugin_api.ja.adoc +++ b/doc/ja/weechat_plugin_api.ja.adoc @@ -3670,6 +3670,55 @@ rc = weechat_crypto_hash_pbkdf2 (data, strlen (data), "sha256", salt, strlen (sa [NOTE] スクリプト API ではこの関数を利用できません。 +// TRANSLATION MISSING +==== crypto_hmac + +_WeeChat バージョン 3.2 以上で利用可。_ + +Compute keyed-hash message authentication code (HMAC). + +プロトタイプ: + +[source,C] +---- +int weechat_crypto_hmac (const void *key, int key_size, const void *message, int message_size, + int hash_algo, void *hash, int *hash_size); +---- + +引数: + +* _key_: the key +* _key_size_: number of bytes in _key_ +* _message_: the message +* _message_size_: number of bytes in _message_ +* _hash_algo_: the hash algorithm, see table in function + <<crypto_hash_algorithms,crypto_hash>> +* _hash_: pointer to the hash variable, which is used to store the resulting hash + (the buffer must be large enough, according to the algorithm, see table + in function <<crypto_hash_algorithms,crypto_hash>>) +* _hash_size_: pointer to a variable used to store the size of the hash computed + (in bytes) (can be NULL) + +戻り値: + +* 成功した場合は 1、失敗した場合は 0 + +C 言語での使用例: + +[source,C] +---- +const char *key = "the key"; +const char *message = "the message"; +char hash[256 / 8]; +int rc, hash_size; +rc = weechat_crypto_hmac (key, strlen (key), message, strlen (message), "sha256", hash, &hash_size); +/* rc == 1, hash_size == 32 and hash is a buffer with: + 47 36 67 02 fc bc b1 97 a4 25 e6 7a b9 52 92 bd 15 9a 66 91 9c fb 94 b0 b4 9a 39 cb c0 24 2d 7b */ +---- + +[NOTE] +スクリプト API ではこの関数を利用できません。 + [[directories]] === ディレクトリ |