4022f4800146f54a6f7f81171c0afb59cc0454bf
[platform/core/security/libwebappenc.git] / srcs / wae_initializer.c
1 /*
2  *  Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License
15  *
16  *
17  * @file        wae_initializer.c
18  * @author      Dongsun Lee (ds73.lee@samsung.com)
19  * @version     1.0
20  * @brief       tool for importing APP DEKs during booting
21  */
22
23 #include "key_handler.h"
24 #include "web_app_enc.h"
25 #include "wae_log.h"
26
27 #include <stdio.h>
28
29 int main(int argc, char* argv[])
30 {
31     int ret = WAE_ERROR_NONE;
32     bool reload = false;
33
34     if(argc == 2 && strcmp(argv[1], "--reload")==0) {
35         reload = true;
36     }
37
38     ret = load_preloaded_app_deks(reload);
39     if(ret == WAE_ERROR_NONE) {
40         printf("WAE INITIALIZER was finished successfully.\n");
41         WAE_SLOGI("WAE INITIALIZER was finished successfully.");
42         return 0;
43     }else {
44         printf("WAE INITIALIZER was finished with error. ret=%d\n", ret);
45         WAE_SLOGE("WAE INITIALIZER was finished with error. ret=%d", ret);
46         return -1;
47     }
48 }