mirror of
https://gitee.com/openharmony/security_crypto_framework
synced 2024-11-27 00:50:49 +00:00
commit
c9f65c3724
@ -61,6 +61,7 @@
|
||||
"algorithm_parameter/detailed_ecc_key_params.h",
|
||||
"algorithm_parameter/detailed_alg_25519_key_params.h",
|
||||
"algorithm_parameter/detailed_gcm_params.h",
|
||||
"algorithm_parameter/detailed_hkdf_params.h",
|
||||
"algorithm_parameter/detailed_iv_params.h",
|
||||
"algorithm_parameter/detailed_pbkdf2_params.h",
|
||||
"algorithm_parameter/detailed_rsa_key_params.h",
|
||||
@ -77,6 +78,7 @@
|
||||
"crypto_operation/md.h",
|
||||
"crypto_operation/rand.h",
|
||||
"crypto_operation/signature.h",
|
||||
"crypto_operation/sm2_crypto_util.h",
|
||||
"key/asy_key_generator.h",
|
||||
"key/dh_key_util.h",
|
||||
"key/ecc_key_util.h",
|
||||
@ -88,7 +90,7 @@
|
||||
"key/sym_key_generator.h",
|
||||
"key/sym_key.h"
|
||||
],
|
||||
"header_base": "//base/security/crypto_framework/interfaces/innerkits"
|
||||
"header_base": "//base/security/crypto_framework/interfaces/inner_api"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -12,8 +12,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
crypto_framwork_common_inc_path = [
|
||||
"//base/security/crypto_framework/interfaces/innerkits/common",
|
||||
"//base/security/crypto_framework/interfaces/innerkits/algorithm_parameter",
|
||||
"//base/security/crypto_framework/interfaces/inner_api/common",
|
||||
"//base/security/crypto_framework/interfaces/inner_api/algorithm_parameter",
|
||||
"//base/security/crypto_framework/common/inc",
|
||||
]
|
||||
|
||||
|
@ -17,10 +17,10 @@ import("//build/ohos.gni")
|
||||
|
||||
config("framework_config") {
|
||||
include_dirs = [
|
||||
"//base/security/crypto_framework/interfaces/innerkits/algorithm_parameter",
|
||||
"//base/security/crypto_framework/interfaces/innerkits/common",
|
||||
"//base/security/crypto_framework/interfaces/innerkits/crypto_operation",
|
||||
"//base/security/crypto_framework/interfaces/innerkits/key",
|
||||
"//base/security/crypto_framework/interfaces/inner_api/algorithm_parameter",
|
||||
"//base/security/crypto_framework/interfaces/inner_api/common",
|
||||
"//base/security/crypto_framework/interfaces/inner_api/crypto_operation",
|
||||
"//base/security/crypto_framework/interfaces/inner_api/key",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -16,10 +16,10 @@ framework_path = "//base/security/crypto_framework/frameworks"
|
||||
plugin_path = "//base/security/crypto_framework/plugin"
|
||||
|
||||
framework_inc_path = [
|
||||
"${base_path}/interfaces/innerkits/algorithm_parameter",
|
||||
"${base_path}/interfaces/innerkits/common",
|
||||
"${base_path}/interfaces/innerkits/crypto_operation",
|
||||
"${base_path}/interfaces/innerkits/key",
|
||||
"${base_path}/interfaces/inner_api/algorithm_parameter",
|
||||
"${base_path}/interfaces/inner_api/common",
|
||||
"${base_path}/interfaces/inner_api/crypto_operation",
|
||||
"${base_path}/interfaces/inner_api/key",
|
||||
"${base_path}/common/inc",
|
||||
"${plugin_path}/openssl_plugin/common/inc",
|
||||
"${plugin_path}/openssl_plugin/crypto_operation/kdf/inc",
|
||||
@ -67,10 +67,10 @@ framework_files =
|
||||
framework_sm2_crypto_util_files
|
||||
|
||||
framework_inc_lite_path = [
|
||||
"${base_path}/interfaces/innerkits/algorithm_parameter",
|
||||
"${base_path}/interfaces/innerkits/common",
|
||||
"${base_path}/interfaces/innerkits/crypto_operation",
|
||||
"${base_path}/interfaces/innerkits/key",
|
||||
"${base_path}/interfaces/inner_api/algorithm_parameter",
|
||||
"${base_path}/interfaces/inner_api/common",
|
||||
"${base_path}/interfaces/inner_api/crypto_operation",
|
||||
"${base_path}/interfaces/inner_api/key",
|
||||
"${base_path}/common/inc",
|
||||
"${plugin_path}/mbedtls_plugin/common",
|
||||
"${plugin_path}/mbedtls_plugin/md/inc",
|
||||
|
@ -1,32 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef HCF_DETAILED_PBKDF2_PARAMS_H
|
||||
#define HCF_DETAILED_PBKDF2_PARAMS_H
|
||||
|
||||
#include "blob.h"
|
||||
#include "kdf_params.h"
|
||||
|
||||
typedef struct HcfPBKDF2ParamsSpec HcfPBKDF2ParamsSpec;
|
||||
|
||||
struct HcfPBKDF2ParamsSpec {
|
||||
HcfKdfParamsSpec base;
|
||||
HcfBlob password;
|
||||
HcfBlob salt;
|
||||
int iterations;
|
||||
HcfBlob output;
|
||||
};
|
||||
|
||||
#endif // HCF_DETAILED_PBKDF2_PARAMS_H
|
||||
/*
|
||||
* Copyright (C) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef HCF_DETAILED_PBKDF2_PARAMS_H
|
||||
#define HCF_DETAILED_PBKDF2_PARAMS_H
|
||||
|
||||
#include "blob.h"
|
||||
#include "kdf_params.h"
|
||||
|
||||
typedef struct HcfPBKDF2ParamsSpec HcfPBKDF2ParamsSpec;
|
||||
|
||||
struct HcfPBKDF2ParamsSpec {
|
||||
HcfKdfParamsSpec base;
|
||||
HcfBlob password;
|
||||
HcfBlob salt;
|
||||
int iterations;
|
||||
HcfBlob output;
|
||||
};
|
||||
|
||||
#endif // HCF_DETAILED_PBKDF2_PARAMS_H
|
@ -1,25 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef HCF_KDF_PARAMS_H
|
||||
#define HCF_KDF_PARAMS_H
|
||||
|
||||
typedef struct HcfKdfParamsSpec HcfKdfParamsSpec;
|
||||
|
||||
struct HcfKdfParamsSpec {
|
||||
const char *algName;
|
||||
};
|
||||
|
||||
#endif // HCF_KFD_PARAMS_H
|
||||
/*
|
||||
* Copyright (C) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef HCF_KDF_PARAMS_H
|
||||
#define HCF_KDF_PARAMS_H
|
||||
|
||||
typedef struct HcfKdfParamsSpec HcfKdfParamsSpec;
|
||||
|
||||
struct HcfKdfParamsSpec {
|
||||
const char *algName;
|
||||
};
|
||||
|
||||
#endif // HCF_KFD_PARAMS_H
|
@ -1,57 +1,57 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef HCF_KDF_H
|
||||
#define HCF_KDF_H
|
||||
|
||||
#include "result.h"
|
||||
#include "object_base.h"
|
||||
#include "kdf_params.h"
|
||||
|
||||
typedef struct HcfKdf HcfKdf;
|
||||
/**
|
||||
* @brief this class provides kdf algorithms for key derivation,
|
||||
*
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
struct HcfKdf {
|
||||
HcfObjectBase base;
|
||||
|
||||
const char *(*getAlgorithm)(HcfKdf *self);
|
||||
|
||||
HcfResult (*generateSecret)(HcfKdf *self, HcfKdfParamsSpec* paramsSpec);
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Generate a corresponding key derivation operation kdf object according to the algorithm name.
|
||||
*
|
||||
* @param transformation Specifies the type of generated kdf object.
|
||||
* @param returnObj The address of the pointer to the generated kdf object.
|
||||
* @return Returns the status code of the execution.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
HcfResult HcfKdfCreate(const char *transformation, HcfKdf **returnObj);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Copyright (C) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef HCF_KDF_H
|
||||
#define HCF_KDF_H
|
||||
|
||||
#include "result.h"
|
||||
#include "object_base.h"
|
||||
#include "kdf_params.h"
|
||||
|
||||
typedef struct HcfKdf HcfKdf;
|
||||
/**
|
||||
* @brief this class provides kdf algorithms for key derivation,
|
||||
*
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
struct HcfKdf {
|
||||
HcfObjectBase base;
|
||||
|
||||
const char *(*getAlgorithm)(HcfKdf *self);
|
||||
|
||||
HcfResult (*generateSecret)(HcfKdf *self, HcfKdfParamsSpec* paramsSpec);
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Generate a corresponding key derivation operation kdf object according to the algorithm name.
|
||||
*
|
||||
* @param transformation Specifies the type of generated kdf object.
|
||||
* @param returnObj The address of the pointer to the generated kdf object.
|
||||
* @return Returns the status code of the execution.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
HcfResult HcfKdfCreate(const char *transformation, HcfKdf **returnObj);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -17,10 +17,10 @@ import("//build/ohos.gni")
|
||||
|
||||
config("plugin_config") {
|
||||
include_dirs = [
|
||||
"//base/security/crypto_framework/interfaces/innerkits/algorithm_parameter",
|
||||
"//base/security/crypto_framework/interfaces/innerkits/common",
|
||||
"//base/security/crypto_framework/interfaces/innerkits/crypto_operation",
|
||||
"//base/security/crypto_framework/interfaces/innerkits/key",
|
||||
"//base/security/crypto_framework/interfaces/inner_api/algorithm_parameter",
|
||||
"//base/security/crypto_framework/interfaces/inner_api/common",
|
||||
"//base/security/crypto_framework/interfaces/inner_api/crypto_operation",
|
||||
"//base/security/crypto_framework/interfaces/inner_api/key",
|
||||
"//base/security/crypto_framework/frameworks/spi",
|
||||
]
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ base_path = "//base/security/crypto_framework"
|
||||
plugin_path = "//base/security/crypto_framework/plugin"
|
||||
|
||||
plugin_inc_path = [
|
||||
"${base_path}/interfaces/innerkits/common",
|
||||
"${base_path}/interfaces/inner_api/common",
|
||||
"${plugin_path}/openssl_plugin/common/inc",
|
||||
"${plugin_path}/openssl_plugin/key/asy_key_generator/inc",
|
||||
"${plugin_path}/openssl_plugin/key/sym_key_generator/inc",
|
||||
@ -98,7 +98,7 @@ plugin_files = plugin_asy_key_generator_files + plugin_key_agreement_files +
|
||||
plugin_common_files + plugin_kdf_files
|
||||
|
||||
mbedtls_plugin_inc_path = [
|
||||
"${base_path}/interfaces/innerkits/common",
|
||||
"${base_path}/interfaces/inner_api/common",
|
||||
"${plugin_path}/mbedtls_plugin/common",
|
||||
"${plugin_path}/mbedtls_plugin/md/inc",
|
||||
"${plugin_path}/mbedtls_plugin/rand/inc",
|
||||
|
@ -26,7 +26,7 @@ ohos_unittest("crypto_framework_test") {
|
||||
include_dirs += [
|
||||
"../../plugin/openssl_plugin/key/asy_key_generator/src",
|
||||
"../../plugin/openssl_plugin/crypto_operation/signature/src",
|
||||
"../../interfaces/innerkits/key/",
|
||||
"../../interfaces/inner_api/key/",
|
||||
"../../interfaces/kits/native/include/",
|
||||
]
|
||||
include_dirs +=
|
||||
|
Loading…
Reference in New Issue
Block a user