|
1 /** |
|
2 * XML Security Library (http://www.aleksey.com/xmlsec). |
|
3 * |
|
4 * KeyInfo node processing |
|
5 * |
|
6 * This is free software; see Copyright file in the source |
|
7 * distribution for preciese wording. |
|
8 * |
|
9 * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com> |
|
10 * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. |
|
11 */ |
|
12 #ifndef __XMLSEC_TEMPLATES_H__ |
|
13 #define __XMLSEC_TEMPALTES_H__ |
|
14 |
|
15 #ifdef __cplusplus |
|
16 extern "C" { |
|
17 #endif /* __cplusplus */ |
|
18 |
|
19 #include <libxml2_tree.h> |
|
20 #include "xmlsec_config.h" |
|
21 #include "xmlsec_xmlsec.h" |
|
22 #include "xmlsec_transforms.h" |
|
23 |
|
24 /*********************************************************************** |
|
25 * |
|
26 * <dsig:Signature> node |
|
27 * |
|
28 **********************************************************************/ |
|
29 XMLSEC_EXPORT xmlNodePtr xmlSecTmplSignatureCreate (xmlDocPtr doc, |
|
30 xmlSecTransformId c14nMethodId, |
|
31 xmlSecTransformId signMethodId, |
|
32 const xmlChar *id); |
|
33 XMLSEC_EXPORT xmlNodePtr xmlSecTmplSignatureEnsureKeyInfo (xmlNodePtr signNode, |
|
34 const xmlChar *id); |
|
35 XMLSEC_EXPORT xmlNodePtr xmlSecTmplSignatureAddReference (xmlNodePtr signNode, |
|
36 xmlSecTransformId digestMethodId, |
|
37 const xmlChar *id, |
|
38 const xmlChar *uri, |
|
39 const xmlChar *type); |
|
40 XMLSEC_EXPORT xmlNodePtr xmlSecTmplSignatureAddObject (xmlNodePtr signNode, |
|
41 const xmlChar *id, |
|
42 const xmlChar *mimeType, |
|
43 const xmlChar *encoding); |
|
44 XMLSEC_EXPORT xmlNodePtr xmlSecTmplSignatureGetSignMethodNode (xmlNodePtr signNode); |
|
45 XMLSEC_EXPORT xmlNodePtr xmlSecTmplSignatureGetC14NMethodNode (xmlNodePtr signNode); |
|
46 |
|
47 XMLSEC_EXPORT xmlNodePtr xmlSecTmplReferenceAddTransform (xmlNodePtr referenceNode, |
|
48 xmlSecTransformId transformId); |
|
49 XMLSEC_EXPORT xmlNodePtr xmlSecTmplObjectAddSignProperties (xmlNodePtr objectNode, |
|
50 const xmlChar *id, |
|
51 const xmlChar *target); |
|
52 XMLSEC_EXPORT xmlNodePtr xmlSecTmplObjectAddManifest (xmlNodePtr objectNode, |
|
53 const xmlChar *id); |
|
54 XMLSEC_EXPORT xmlNodePtr xmlSecTmplManifestAddReference (xmlNodePtr manifestNode, |
|
55 xmlSecTransformId digestMethodId, |
|
56 const xmlChar *id, |
|
57 const xmlChar *uri, |
|
58 const xmlChar *type); |
|
59 |
|
60 /*********************************************************************** |
|
61 * |
|
62 * <enc:EncryptedData> node |
|
63 * |
|
64 **********************************************************************/ |
|
65 XMLSEC_EXPORT xmlNodePtr xmlSecTmplEncDataCreate (xmlDocPtr doc, |
|
66 xmlSecTransformId encMethodId, |
|
67 const xmlChar *id, |
|
68 const xmlChar *type, |
|
69 const xmlChar *mimeType, |
|
70 const xmlChar *encoding); |
|
71 XMLSEC_EXPORT xmlNodePtr xmlSecTmplEncDataEnsureKeyInfo (xmlNodePtr encNode, |
|
72 const xmlChar *id); |
|
73 XMLSEC_EXPORT xmlNodePtr xmlSecTmplEncDataEnsureEncProperties (xmlNodePtr encNode, |
|
74 const xmlChar *id); |
|
75 XMLSEC_EXPORT xmlNodePtr xmlSecTmplEncDataAddEncProperty (xmlNodePtr encNode, |
|
76 const xmlChar *id, |
|
77 const xmlChar *target); |
|
78 XMLSEC_EXPORT xmlNodePtr xmlSecTmplEncDataEnsureCipherValue (xmlNodePtr encNode); |
|
79 XMLSEC_EXPORT xmlNodePtr xmlSecTmplEncDataEnsureCipherReference (xmlNodePtr encNode, |
|
80 const xmlChar *uri); |
|
81 XMLSEC_EXPORT xmlNodePtr xmlSecTmplEncDataGetEncMethodNode (xmlNodePtr encNode); |
|
82 XMLSEC_EXPORT xmlNodePtr xmlSecTmplCipherReferenceAddTransform (xmlNodePtr cipherReferenceNode, |
|
83 xmlSecTransformId transformId); |
|
84 |
|
85 /*********************************************************************** |
|
86 * |
|
87 * <enc:EncryptedKey> node |
|
88 * |
|
89 **********************************************************************/ |
|
90 XMLSEC_EXPORT xmlNodePtr xmlSecTmplReferenceListAddDataReference(xmlNodePtr encNode, |
|
91 const xmlChar *uri); |
|
92 XMLSEC_EXPORT xmlNodePtr xmlSecTmplReferenceListAddKeyReference (xmlNodePtr encNode, |
|
93 const xmlChar *uri); |
|
94 |
|
95 /*********************************************************************** |
|
96 * |
|
97 * <dsig:KeyInfo> node |
|
98 * |
|
99 **********************************************************************/ |
|
100 XMLSEC_EXPORT xmlNodePtr xmlSecTmplKeyInfoAddKeyName (xmlNodePtr keyInfoNode, |
|
101 const xmlChar* name); |
|
102 XMLSEC_EXPORT xmlNodePtr xmlSecTmplKeyInfoAddKeyValue (xmlNodePtr keyInfoNode); |
|
103 XMLSEC_EXPORT xmlNodePtr xmlSecTmplKeyInfoAddX509Data (xmlNodePtr keyInfoNode); |
|
104 XMLSEC_EXPORT xmlNodePtr xmlSecTmplKeyInfoAddRetrievalMethod (xmlNodePtr keyInfoNode, |
|
105 const xmlChar *uri, |
|
106 const xmlChar *type); |
|
107 XMLSEC_EXPORT xmlNodePtr xmlSecTmplRetrievalMethodAddTransform (xmlNodePtr retrMethodNode, |
|
108 xmlSecTransformId transformId); |
|
109 XMLSEC_EXPORT xmlNodePtr xmlSecTmplKeyInfoAddEncryptedKey (xmlNodePtr keyInfoNode, |
|
110 xmlSecTransformId encMethodId, |
|
111 const xmlChar *id, |
|
112 const xmlChar *type, |
|
113 const xmlChar *recipient); |
|
114 |
|
115 /*********************************************************************** |
|
116 * |
|
117 * <dsig:X509Data> node |
|
118 * |
|
119 **********************************************************************/ |
|
120 XMLSEC_EXPORT xmlNodePtr xmlSecTmplX509DataAddIssuerSerial (xmlNodePtr x509DataNode); |
|
121 XMLSEC_EXPORT xmlNodePtr xmlSecTmplX509DataAddSubjectName (xmlNodePtr x509DataNode); |
|
122 XMLSEC_EXPORT xmlNodePtr xmlSecTmplX509DataAddSKI (xmlNodePtr x509DataNode); |
|
123 XMLSEC_EXPORT xmlNodePtr xmlSecTmplX509DataAddCertificate (xmlNodePtr x509DataNode); |
|
124 XMLSEC_EXPORT xmlNodePtr xmlSecTmplX509DataAddCRL (xmlNodePtr x509DataNode); |
|
125 |
|
126 /*********************************************************************** |
|
127 * |
|
128 * <dsig:Transform> node |
|
129 * |
|
130 **********************************************************************/ |
|
131 XMLSEC_EXPORT int xmlSecTmplTransformAddHmacOutputLength (xmlNodePtr transformNode, |
|
132 xmlSecSize bitsLen); |
|
133 XMLSEC_EXPORT int xmlSecTmplTransformAddRsaOaepParam (xmlNodePtr transformNode, |
|
134 const xmlSecByte *buf, |
|
135 xmlSecSize size); |
|
136 XMLSEC_EXPORT int xmlSecTmplTransformAddXsltStylesheet (xmlNodePtr transformNode, |
|
137 const xmlChar *xslt); |
|
138 XMLSEC_EXPORT int xmlSecTmplTransformAddC14NInclNamespaces(xmlNodePtr transformNode, |
|
139 const xmlChar *prefixList); |
|
140 XMLSEC_EXPORT int xmlSecTmplTransformAddXPath (xmlNodePtr transformNode, |
|
141 const xmlChar *expression, |
|
142 const xmlChar **nsList); |
|
143 XMLSEC_EXPORT int xmlSecTmplTransformAddXPath2 (xmlNodePtr transformNode, |
|
144 const xmlChar* type, |
|
145 const xmlChar *expression, |
|
146 const xmlChar **nsList); |
|
147 XMLSEC_EXPORT int xmlSecTmplTransformAddXPointer (xmlNodePtr transformNode, |
|
148 const xmlChar *expression, |
|
149 const xmlChar **nsList); |
|
150 /*********************************************************************** |
|
151 * |
|
152 * Template properties |
|
153 * |
|
154 **********************************************************************/ |
|
155 |
|
156 XMLSEC_EXPORT void xmlSetNewLineFlag(int aNewLine); |
|
157 |
|
158 int xmlGetNewLineFlag(); |
|
159 |
|
160 XMLSEC_EXPORT void xmlSetPrefix(unsigned char* aPref); |
|
161 |
|
162 unsigned char* xmlGetPrefix(); |
|
163 |
|
164 #ifdef __cplusplus |
|
165 } |
|
166 #endif /* __cplusplus */ |
|
167 |
|
168 #endif /* __XMLSEC_KEYINFO_TEMPLATES_H__ */ |
|
169 |