1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef HKS_SM_IMPORT_WRAP_KEY_H 17 #define HKS_SM_IMPORT_WRAP_KEY_H 18 19 #include <stdint.h> 20 21 #include "hks_keynode.h" 22 #include "hks_type.h" 23 24 #ifdef __cplusplus 25 extern "C" 26 { 27 #endif 28 struct HksSmWrappedKeyDataBlob { 29 struct HksBlob peerPublicKey; 30 struct HksBlob kekAndSignData; 31 struct HksBlob kekData; 32 struct HksBlob signData; 33 struct HksBlob deriveKekData1; 34 struct HksBlob deriveKekData2; 35 struct HksBlob originKey; 36 uint32_t signatureDataLength; 37 }; 38 39 int32_t HksSmImportWrappedKey(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet, 40 const struct HksBlob *wrappingKey, const struct HksBlob *wrappedKeyData, struct HksBlob *keyOut); 41 #ifdef __cplusplus 42 } 43 #endif 44 45 #endif /* HKS_SM_IMPORT_WRAP_KEY_H */