Update source from tizen 2.3
[platform/core/base/rpm-installer.git] / backend / src / rpm / inc / rpm-installer-signature.h
1 /*
2  * rpm-installer
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7  * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23 #ifndef __RPM_INSTALLER_SIGNATURE_H_
24 #define __RPM_INSTALLER_SIGNATURE_H_
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif                          /* __cplusplus */
29
30 typedef struct transform_x {
31         const char *algorithm;
32         struct transform_x *prev;
33         struct transform_x *next;
34 } transform_x;
35
36 typedef struct digestmethod_x {
37         const char *algorithm;
38         struct digestmethod_x *prev;
39         struct digestmethod_x *next;
40 } digestmethod_x;
41
42 typedef struct digestvalue_x {
43         const char *text;
44         struct digestvalue_x *prev;
45         struct digestvalue_x *next;
46 } digestvalue_x;
47
48 typedef struct transforms_x {
49         struct transform_x *transform;
50         struct transforms_x *prev;
51         struct transforms_x *next;
52 } transforms_x;
53
54 typedef struct x509certificate_x {
55         const char *text;
56         struct x509certificate_x *prev;
57         struct x509certificate_x *next;
58 } x509certificate_x;
59
60 typedef struct reference_x {
61         const char *uri;
62         struct transforms_x *transforms;
63         struct digestmethod_x *digestmethod;
64         struct digestvalue_x *digestvalue;
65         struct reference_x *prev;
66         struct reference_x *next;
67 } reference_x;
68
69 typedef struct cannonicalizationmethod_x {
70         const char *algorithm;
71         struct cannonicalizationmethod_x *prev;
72         struct cannonicalizationmethod_x *next;
73 } cannonicalizationmethod_x;
74
75 typedef struct signaturemethod_x {
76         const char *algorithm;
77         struct signaturemethod_x *prev;
78         struct signaturemethod_x *next;
79 } signaturemethod_x;
80
81 typedef struct x509data_x {
82         x509certificate_x *x509certificate;
83         struct x509data_x *prev;
84         struct x509data_x *next;
85 } x509data_x;
86
87 typedef struct signedinfo_x {
88         struct cannonicalizationmethod_x *cannonicalizationmethod;
89         struct signaturemethod_x *signaturemethod;
90         struct reference_x *reference;
91         struct signedinfo_x *prev;
92         struct signedinfo_x *next;
93 } signedinfo_x;
94
95 typedef struct signaturevalue_x {
96         const char *text;
97         struct signaturevalue_x *prev;
98         struct signaturevalue_x *next;
99 } signaturevalue_x;
100
101 typedef struct keyinfo_x {
102         struct x509data_x *x509data;
103         struct keyinfo_x *prev;
104         struct keyinfo_x *next;
105 } keyinfo_x;
106
107 /*This will be parsed later when requirement arises*/
108 typedef struct object_x {
109         const char *id;
110         struct object_x *prev;
111         struct object_x *next;
112 } object_x;
113
114 typedef struct signature_x {    /*signature xml*/
115         const char *id;         /* distributor or author sign*/
116         const char *xmlns;      /* namespace*/
117         struct signedinfo_x *signedinfo;        /*signature data*/
118         struct signaturevalue_x *signaturevalue;        /* signature value*/
119         struct keyinfo_x *keyinfo;      /*cert info*/
120         struct object_x *object;        /*other parameters in object tag*/
121 } signature_x;
122
123
124 signature_x *_ri_process_signature_xml(const char *signature_file);
125 void _ri_free_signature_xml(signature_x *sigx);
126
127 #ifdef __cplusplus
128 }
129 #endif                          /* __cplusplus */
130 #endif                          /* __RPM_INSTALLER_SIGNATURE_H_ */