Implemented EncryptionMethod schema snippet.
[shibboleth/cpp-xmltooling.git] / xmltooling / encryption / Encryption.h
1 /*
2  *  Copyright 2001-2006 Internet2
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 /**
18  * @file Encryption.h
19  * 
20  * XMLObjects representing XML Encryption content
21  */
22
23 #ifndef __xmltooling_encrypt_h__
24 #define __xmltooling_encrypt_h__
25
26 #include <xmltooling/ElementProxy.h>
27 #include <xmltooling/SimpleElement.h>
28 #include <xmltooling/XMLObjectBuilder.h>
29 #include <xmltooling/util/XMLConstants.h>
30 #include <xmltooling/validation/ValidatingXMLObject.h>
31
32 #define DECL_XMLENCOBJECTBUILDER(cname) \
33     DECL_XMLOBJECTBUILDER(XMLTOOL_API,cname,xmltooling::XMLConstants::XMLENC_NS,xmltooling::XMLConstants::XMLENC_PREFIX)
34
35 /**
36  * @namespace xmlencryption
37  * Namespace for XML Encryption schema objects
38  */
39 namespace xmlencryption {
40
41     DECL_XMLOBJECT_SIMPLE(XMLTOOL_API,OAEPparams,Name,XML Encryption OAEPparams element);
42
43     BEGIN_XMLOBJECT(XMLTOOL_API,KeySize,xmltooling::SimpleElement,XML Encryption KeySize element);
44         DECL_INTEGER_CONTENT(Size);
45     END_XMLOBJECT;
46
47     BEGIN_XMLOBJECT(XMLTOOL_API,EncryptionMethod,xmltooling::XMLObject,XML Encryption EncryptionMethod element);
48         DECL_STRING_ATTRIB(Algorithm,ALGORITHM);
49         DECL_TYPED_CHILD(KeySize);
50         DECL_TYPED_CHILD(OAEPparams);
51         DECL_XMLOBJECT_CHILDREN(OtherParameter);
52         /** EncryptionMethodType local name */
53         static const XMLCh TYPE_NAME[];
54     END_XMLOBJECT;
55
56     DECL_XMLENCOBJECTBUILDER(OAEPparams);
57     DECL_XMLENCOBJECTBUILDER(KeySize);
58     DECL_XMLENCOBJECTBUILDER(EncryptionMethod);
59
60     /**
61      * Registers builders and validators for XML Encryption classes into the runtime.
62      */
63     void XMLTOOL_API registerEncryptionClasses();
64 };
65
66 #endif /* __xmltooling_encrypt_h__ */