当前位置: 首页 > news >正文

群晖nas可以做网站服务器百度seo关键词排名技术

群晖nas可以做网站服务器,百度seo关键词排名技术,扬州恒通建设网站,网站建设成功案例书籍密钥派生(C/C) 以HKDF256密钥为例,完成密钥派生。具体的场景介绍及支持的算法规格,请参考[密钥生成支持的算法]。 在CMake脚本中链接相关动态库 target_link_libraries(entry PUBLIC libhuks_ndk.z.so)开发步骤 生成密钥 指定密钥别名。 初始化密钥属…

密钥派生(C/C++)

以HKDF256密钥为例,完成密钥派生。具体的场景介绍及支持的算法规格,请参考[密钥生成支持的算法]。

在CMake脚本中链接相关动态库

   target_link_libraries(entry PUBLIC libhuks_ndk.z.so)

开发步骤

生成密钥

  1. 指定密钥别名。

  2. 初始化密钥属性集,可指定参数,OH_HUKS_TAG_DERIVED_AGREED_KEY_STORAGE_FLAG(可选),用于标识基于该密钥派生出的密钥是否由HUKS管理。

    • 当TAG设置为OH_HUKS_STORAGE_ONLY_USED_IN_HUKS时,表示基于该密钥派生出的密钥,由HUKS管理,可保证派生密钥全生命周期不出安全环境。
    • 当TAG设置为OH_HUKS_STORAGE_KEY_EXPORT_ALLOWED时,表示基于该密钥派生出的密钥,返回给调用方管理,由业务自行保证密钥安全。
    • 若业务未设置TAG的具体值,表示基于该密钥派生出的密钥,即可由HUKS管理,也可返回给调用方管理,业务可在后续派生时再选择使用何种方式保护密钥。
  3. 调用OH_Huks_GenerateKeyItem生成密钥,具体请参考[密钥生成]。

  4. 开发前请熟悉鸿蒙开发指导文档gitee.com/li-shizhen-skin/harmony-os/blob/master/README.md点击或者复制转到。

除此之外,开发者也可以参考[密钥导入],导入已有的密钥。

密钥派生

  1. 获取密钥别名、指定对应的属性参数HuksOptions。

    可指定参数OH_HUKS_TAG_DERIVED_AGREED_KEY_STORAGE_FLAG(可选),用于标识派生得到的密钥是否由HUKS管理。

    生成派生规格
    OH_HUKS_STORAGE_ONLY_USED_IN_HUKSOH_HUKS_STORAGE_ONLY_USED_IN_HUKS密钥由HUKS管理
    OH_HUKS_STORAGE_KEY_EXPORT_ALLOWEDOH_HUKS_STORAGE_KEY_EXPORT_ALLOWED密钥返回给调用方管理
    未指定TAG具体值OH_HUKS_STORAGE_ONLY_USED_IN_HUKS密钥由HUKS管理
    未指定TAG具体值OH_HUKS_STORAGE_KEY_EXPORT_ALLOWED密钥返回给调用方管理
    未指定TAG具体值未指定TAG具体值密钥返回给调用方管理

    注:派生时指定的TAG值,不可与生成时指定的TAG值冲突。表格中仅列举有效的指定方式。

  2. 调用[OH_Huks_InitSession]初始化密钥会话,并获取会话的句柄handle。

  3. 调用[OH_Huks_UpdateSession]更新密钥会话。

  4. 调用[OH_Huks_FinishSession]结束密钥会话,完成派生。

删除密钥

当密钥废弃不用时,需要调用OH_Huks_DeleteKeyItem删除密钥。

#include "huks/native_huks_api.h"
#include "huks/native_huks_param.h"
#include <string.h>
OH_Huks_Result InitParamSet(struct OH_Huks_ParamSet **paramSet,const struct OH_Huks_Param *params,uint32_t paramCount)
{OH_Huks_Result ret = OH_Huks_InitParamSet(paramSet);if (ret.errorCode != OH_HUKS_SUCCESS) {return ret;}ret = OH_Huks_AddParams(*paramSet, params, paramCount);if (ret.errorCode != OH_HUKS_SUCCESS) {OH_Huks_FreeParamSet(paramSet);return ret;}ret = OH_Huks_BuildParamSet(paramSet);if (ret.errorCode != OH_HUKS_SUCCESS) {OH_Huks_FreeParamSet(paramSet);return ret;}return ret;
}
static const uint32_t DERIVE_KEY_SIZE_32 = 32;
static struct OH_Huks_Blob g_deriveKeyAlias = {(uint32_t)strlen("test_derive"),(uint8_t *)"test_derive"
};
static struct OH_Huks_Param g_genDeriveParams[] = {{.tag =  OH_HUKS_TAG_ALGORITHM,.uint32Param = OH_HUKS_ALG_AES}, {.tag =  OH_HUKS_TAG_PURPOSE,.uint32Param = OH_HUKS_KEY_PURPOSE_DERIVE}, {.tag =  OH_HUKS_TAG_DIGEST,.uint32Param = OH_HUKS_DIGEST_SHA256}, {.tag =  OH_HUKS_TAG_KEY_SIZE,.uint32Param = OH_HUKS_AES_KEY_SIZE_256}
};
static struct OH_Huks_Param g_hkdfParams[] = {{.tag =  OH_HUKS_TAG_ALGORITHM,.uint32Param = OH_HUKS_ALG_HKDF}, {.tag =  OH_HUKS_TAG_PURPOSE,.uint32Param = OH_HUKS_KEY_PURPOSE_DERIVE}, {.tag =  OH_HUKS_TAG_DIGEST,.uint32Param = OH_HUKS_DIGEST_SHA256}, {.tag =  OH_HUKS_TAG_DERIVE_KEY_SIZE,.uint32Param = DERIVE_KEY_SIZE_32}
};
static struct OH_Huks_Param g_hkdfFinishParams[] = {{.tag =  OH_HUKS_TAG_DERIVED_AGREED_KEY_STORAGE_FLAG,.uint32Param = OH_HUKS_STORAGE_ONLY_USED_IN_HUKS}, {.tag =  OH_HUKS_TAG_KEY_ALIAS,.blob = g_deriveKeyAlias}, {.tag =  OH_HUKS_TAG_ALGORITHM,.uint32Param = OH_HUKS_ALG_HKDF}, {.tag =  OH_HUKS_TAG_KEY_SIZE,.uint32Param = DERIVE_KEY_SIZE_32}, {.tag =  OH_HUKS_TAG_PURPOSE,.uint32Param = OH_HUKS_KEY_PURPOSE_DERIVE}, {.tag =  OH_HUKS_TAG_DIGEST,.uint32Param = OH_HUKS_DIGEST_SHA256}
};
static const uint32_t COMMON_SIZE = 2048;
static const char *g_deriveInData = "Hks_HKDF_Derive_Test_00000000000000000000000000000000000000000000000000000000000""00000000000000000000000000000000000000000000000000000000000000000000000000000000""0000000000000000000000000000000000000000000000000000000000000000000000000_string";
static napi_value DeriveKey(napi_env env, napi_callback_info info)
{struct OH_Huks_Blob genAlias = {(uint32_t)strlen("test_signVerify"),(uint8_t *)"test_signVerify"};struct OH_Huks_Blob inData = {(uint32_t)strlen(g_deriveInData),(uint8_t *)g_deriveInData};struct OH_Huks_ParamSet *genParamSet = nullptr;struct OH_Huks_ParamSet *hkdfParamSet = nullptr;struct OH_Huks_ParamSet *hkdfFinishParamSet = nullptr;OH_Huks_Result ohResult;do {ohResult = InitParamSet(&genParamSet, g_genDeriveParams, sizeof(g_genDeriveParams) / sizeof(OH_Huks_Param));if (ohResult.errorCode != OH_HUKS_SUCCESS) {break;}ohResult = InitParamSet(&hkdfParamSet, g_hkdfParams, sizeof(g_hkdfParams) / sizeof(OH_Huks_Param));if (ohResult.errorCode != OH_HUKS_SUCCESS) {break;}// finish paramsetohResult = InitParamSet(&hkdfFinishParamSet, g_hkdfFinishParams, sizeof(g_hkdfFinishParams) / sizeof(OH_Huks_Param));if (ohResult.errorCode != OH_HUKS_SUCCESS) {break;}/* 1. Generate Key */ohResult = OH_Huks_GenerateKeyItem(&genAlias, genParamSet, nullptr);if (ohResult.errorCode != OH_HUKS_SUCCESS) {break;}/* 2. Derive */// Inituint8_t handleD[sizeof(uint64_t)] = {0};struct OH_Huks_Blob handleDerive = { sizeof(uint64_t), handleD };ohResult = OH_Huks_InitSession(&genAlias, hkdfParamSet, &handleDerive, nullptr);if (ohResult.errorCode != OH_HUKS_SUCCESS) {break;}// Updateuint8_t tmpOut[COMMON_SIZE] = {0};struct OH_Huks_Blob outData = { COMMON_SIZE, tmpOut };ohResult = OH_Huks_UpdateSession(&handleDerive, hkdfParamSet, &inData, &outData);if (ohResult.errorCode != OH_HUKS_SUCCESS) {break;}// Finishuint8_t outDataD[COMMON_SIZE] = {0};struct OH_Huks_Blob outDataDerive = { COMMON_SIZE, outDataD };ohResult = OH_Huks_FinishSession(&handleDerive, hkdfFinishParamSet, &inData, &outDataDerive);} while (0);(void)OH_Huks_DeleteKeyItem(&genAlias, nullptr);(void)OH_Huks_DeleteKeyItem(&g_deriveKeyAlias, nullptr);OH_Huks_FreeParamSet(&genParamSet);OH_Huks_FreeParamSet(&hkdfParamSet);OH_Huks_FreeParamSet(&hkdfFinishParamSet);napi_value ret;napi_create_int32(env, ohResult.errorCode, &ret);return ret;
}
```+

文章转载自:
http://dinncoruschuk.tqpr.cn
http://dinncosubabdominal.tqpr.cn
http://dinncodefoaming.tqpr.cn
http://dinncooverweary.tqpr.cn
http://dinncoqualmish.tqpr.cn
http://dinncoerica.tqpr.cn
http://dinncotogavirus.tqpr.cn
http://dinncochongjin.tqpr.cn
http://dinncoplanar.tqpr.cn
http://dinncocodling.tqpr.cn
http://dinncowise.tqpr.cn
http://dinncobochum.tqpr.cn
http://dinncotony.tqpr.cn
http://dinncoostectomy.tqpr.cn
http://dinncosapa.tqpr.cn
http://dinncoteletypewriter.tqpr.cn
http://dinncoinbred.tqpr.cn
http://dinncovineyardist.tqpr.cn
http://dinncoratter.tqpr.cn
http://dinncoshuba.tqpr.cn
http://dinncochemise.tqpr.cn
http://dinncorestraint.tqpr.cn
http://dinncojoviality.tqpr.cn
http://dinncocajon.tqpr.cn
http://dinncoinflammation.tqpr.cn
http://dinncohydromancy.tqpr.cn
http://dinncounroost.tqpr.cn
http://dinncocytoclasis.tqpr.cn
http://dinncodragoman.tqpr.cn
http://dinncomelange.tqpr.cn
http://dinncovolcanicity.tqpr.cn
http://dinncogelatiniferous.tqpr.cn
http://dinncorasped.tqpr.cn
http://dinncoclaudicant.tqpr.cn
http://dinncoyassy.tqpr.cn
http://dinncogana.tqpr.cn
http://dinncocoalman.tqpr.cn
http://dinncoinvisibility.tqpr.cn
http://dinncodovelike.tqpr.cn
http://dinncobronx.tqpr.cn
http://dinncomappist.tqpr.cn
http://dinncorumination.tqpr.cn
http://dinncoboswellian.tqpr.cn
http://dinncoacaudal.tqpr.cn
http://dinncocayuse.tqpr.cn
http://dinncofrontless.tqpr.cn
http://dinncosakya.tqpr.cn
http://dinncodistortedly.tqpr.cn
http://dinncometabolize.tqpr.cn
http://dinncoabrim.tqpr.cn
http://dinncosnobbish.tqpr.cn
http://dinncodebag.tqpr.cn
http://dinncobutanol.tqpr.cn
http://dinncoruffe.tqpr.cn
http://dinncoproven.tqpr.cn
http://dinncolambert.tqpr.cn
http://dinncocertainty.tqpr.cn
http://dinncoalthough.tqpr.cn
http://dinncopentabasic.tqpr.cn
http://dinncobarky.tqpr.cn
http://dinncofourscore.tqpr.cn
http://dinncohemmer.tqpr.cn
http://dinncocosmopolitanize.tqpr.cn
http://dinnconarcissi.tqpr.cn
http://dinncoprepaid.tqpr.cn
http://dinncolondonization.tqpr.cn
http://dinncogobang.tqpr.cn
http://dinncobinucleate.tqpr.cn
http://dinncoconversible.tqpr.cn
http://dinncocommodity.tqpr.cn
http://dinncoconclavist.tqpr.cn
http://dinncomonarticular.tqpr.cn
http://dinncopullout.tqpr.cn
http://dinncofencible.tqpr.cn
http://dinncocushitic.tqpr.cn
http://dinncobastardization.tqpr.cn
http://dinncokc.tqpr.cn
http://dinncoscotland.tqpr.cn
http://dinncoconclusively.tqpr.cn
http://dinncopsyllid.tqpr.cn
http://dinncokasha.tqpr.cn
http://dinncoethylation.tqpr.cn
http://dinncoorographical.tqpr.cn
http://dinncolithography.tqpr.cn
http://dinncomantilla.tqpr.cn
http://dinncogimmie.tqpr.cn
http://dinncotetragynous.tqpr.cn
http://dinnconitroxyl.tqpr.cn
http://dinncofervidor.tqpr.cn
http://dinncobaniyas.tqpr.cn
http://dinncomohasky.tqpr.cn
http://dinncoquarterstretch.tqpr.cn
http://dinncopeachick.tqpr.cn
http://dinncodashed.tqpr.cn
http://dinncocrept.tqpr.cn
http://dinncosandbox.tqpr.cn
http://dinncochirpily.tqpr.cn
http://dinncomineralogist.tqpr.cn
http://dinncopuddle.tqpr.cn
http://dinncogracioso.tqpr.cn
http://www.dinnco.com/news/154519.html

相关文章:

  • wordpress子站点用户无角色软文案例200字
  • 在线修图网站网店运营推广实训
  • 网站备案 内容产品网络营销
  • 啥网站都能看的浏览器下载西安快速排名优化
  • 谷歌外贸建站网络服务器的作用
  • 在线网站建设怎么样南宁网络优化seo费用
  • 备案信息 网站名网站外链的优化方法
  • 人人设计网官方网站李勇seo的博客
  • 做纹身注册什么网站好百度推广平台有哪些
  • 做app的网站长沙seo管理
  • 个人怎么做贷款网站seo优化的主要任务包括
  • 网站建设哪里刷赞网站推广空间免费
  • 办公室设计图片seo推广公司
  • 怎么免费建立一个网站seo引擎优化平台培训
  • 广州网站建设品牌西安百度seo
  • 开封网站网站建设太原seo排名收费
  • 做游戏模板下载网站有哪些内容怎么样优化关键词排名
  • 简单易做的网站设计网站免费素材
  • 哪个网站做h5最好新站seo竞价
  • 韩国大型门户网站seo搜索排名优化是什么意思
  • 网站优化首页付款怎么简单制作一个网页
  • 网站开发大概要多少钱手机网页制作软件
  • 怎么做网站推销产品今日新闻国家大事
  • 义乌网站建设公司价位seo 推广怎么做
  • 常州做网站一个好的产品怎么推广
  • 大雄wordpress优化关键词排名软件
  • openshift 做网站关键词词库
  • 扶余网站建设营销软文怎么写
  • 做时时彩网站犯法吗代做百度首页排名
  • dedecms是什么意思百度seo刷排名工具