---
title: 创建Context并设定Cipher key
description: "参照创建Context并设定Cipher key，仅增加回调函数的设置，用于任务完成后，poll线程进行调用。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/251RC1/accel/kunpengaccel_17_0080.html
sourcePath: /source/zh/kunpengboostkithistory/251RC1/accel/kunpengaccel_17_0080.html
indexId: 080774f5083589484639ac26b89b62fbd9d209d1831584c2ea3dc604e05dafad72
---
# 创建Context并设定Cipher key

参照创建Context并设定Cipher key，仅增加回调函数的设置，用于任务完成后，poll线程进行调用。

```
static void _cipher_cb(void *message, void *cipher_tag)
{
struct cipher_async_tag *tag = cipher_tag;
 void *ctx = tag->ctx;
 int thread_id = tag->thread_id;
 int cnt = tag->cnt;
struct wcrypto_cipher_msg *msg = message;
if (msg->status = WD_SUCCESS)
printf("thread %d do cipher %dth time success!\n", thread_id, cnt);
else
printf("thread %d do RSA %dth time fail(status=%d)!\n", thread_id, cnt, 
msg->status);
free(cipher_tag);
}
setup.cb = (void *)_cipher_cb;
……
```
