“818e070890bc5d18caa914c60a109c86e6e75549”上不存在“...fluid/git@gitcode.net:s920243400/PaddleDetection.git”
未验证 提交 eaba6c10 编写于 作者: 胡啸天 提交者: Gitee

update zh-cn/application-dev/security/cryptoFramework-guidelines.md. to modify algName

Signed-off-by: N胡啸天 <huxiaotian2@huawei.com>
上级 ec800506
...@@ -249,7 +249,7 @@ function genGcmParamsSpec() { ...@@ -249,7 +249,7 @@ function genGcmParamsSpec() {
arr = [0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0]; // 16 bytes arr = [0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0]; // 16 bytes
let dataTag = new Uint8Array(arr); let dataTag = new Uint8Array(arr);
let tagBlob = {data : dataTag}; let tagBlob = {data : dataTag};
let gcmParamsSpec = {iv : ivBlob, aad : aadBlob, authTag : tagBlob, algoName : "GcmParamsSpec"}; let gcmParamsSpec = {iv : ivBlob, aad : aadBlob, authTag : tagBlob, algName : "GcmParamsSpec"};
return gcmParamsSpec; return gcmParamsSpec;
} }
...@@ -296,8 +296,8 @@ function testAesGcm() { ...@@ -296,8 +296,8 @@ function testAesGcm() {
}, 10) }, 10)
}).then(() => { }).then(() => {
// 生成对称密钥生成器 // 生成对称密钥生成器
let symAlgoName = 'AES128'; let symAlgName = 'AES128';
let symKeyGenerator = cryptoFramework.createSymKeyGenerator(symAlgoName); let symKeyGenerator = cryptoFramework.createSymKeyGenerator(symAlgName);
if (symKeyGenerator == null) { if (symKeyGenerator == null) {
console.error('createSymKeyGenerator failed'); console.error('createSymKeyGenerator failed');
return; return;
...@@ -309,9 +309,9 @@ function testAesGcm() { ...@@ -309,9 +309,9 @@ function testAesGcm() {
globalGcmParams = genGcmParamsSpec(); globalGcmParams = genGcmParamsSpec();
// 生成加解密生成器 // 生成加解密生成器
let cipherAlgoName = 'AES128|GCM|PKCS7'; let cipherAlgName = 'AES128|GCM|PKCS7';
try { try {
globalCipher = cryptoFramework.createCipher(cipherAlgoName); globalCipher = cryptoFramework.createCipher(cipherAlgName);
console.info(`cipher algName: ${globalCipher.algName}`); console.info(`cipher algName: ${globalCipher.algName}`);
} catch (error) { } catch (error) {
console.error(`createCipher failed, ${error.code}, ${error.message}`); console.error(`createCipher failed, ${error.code}, ${error.message}`);
...@@ -409,8 +409,8 @@ function genKeyMaterialBlob() { ...@@ -409,8 +409,8 @@ function genKeyMaterialBlob() {
// 3DES ECB模式示例,采用已有数据生成密钥(callback写法) // 3DES ECB模式示例,采用已有数据生成密钥(callback写法)
function test3DesEcb() { function test3DesEcb() {
// 生成对称密钥生成器 // 生成对称密钥生成器
let symAlgoName = '3DES192'; let symAlgName = '3DES192';
let symKeyGenerator = cryptoFramework.createSymKeyGenerator(symAlgoName); let symKeyGenerator = cryptoFramework.createSymKeyGenerator(symAlgName);
if (symKeyGenerator == null) { if (symKeyGenerator == null) {
console.error('createSymKeyGenerator failed'); console.error('createSymKeyGenerator failed');
return; return;
...@@ -418,9 +418,9 @@ function test3DesEcb() { ...@@ -418,9 +418,9 @@ function test3DesEcb() {
console.info(`symKeyGenerator algName: ${symKeyGenerator.algName}`); console.info(`symKeyGenerator algName: ${symKeyGenerator.algName}`);
// 生成加解密生成器 // 生成加解密生成器
let cipherAlgoName = '3DES192|ECB|PKCS7'; let cipherAlgName = '3DES192|ECB|PKCS7';
try { try {
globalCipher = cryptoFramework.createCipher(cipherAlgoName); globalCipher = cryptoFramework.createCipher(cipherAlgName);
console.info(`cipher algName: ${globalCipher.algName}`); console.info(`cipher algName: ${globalCipher.algName}`);
} catch (error) { } catch (error) {
console.error(`createCipher failed, ${error.code}, ${error.message}`); console.error(`createCipher failed, ${error.code}, ${error.message}`);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册