2 * Copyright 2001-2006 Internet2
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 * XMLObjects representing XML Digital Signature, version 20020212, KeyInfo element
21 * and related content.
24 #ifndef __xmltooling_keyinfo_h__
25 #define __xmltooling_keyinfo_h__
27 #include <xmltooling/ElementProxy.h>
28 #include <xmltooling/exceptions.h>
29 #include <xmltooling/XMLObjectBuilder.h>
30 #include <xmltooling/util/XMLConstants.h>
31 #include <xmltooling/validation/ValidatingXMLObject.h>
35 #define DECL_XMLSIGOBJECTBUILDER(cname) \
36 DECL_XMLOBJECTBUILDER(XMLTOOL_API,cname,XMLConstants::XMLSIG_NS,XMLConstants::XMLSIG_PREFIX)
38 namespace xmltooling {
41 * XMLObject representing XML Digital Signature, version 20020212, KeyName element.
43 BEGIN_XMLOBJECT(XMLTOOL_API,KeyName,XMLObject);
44 DECL_XMLOBJECT_CONTENT(Name);
48 * XMLObject representing XML Digital Signature, version 20020212, MgmtData element.
50 BEGIN_XMLOBJECT(XMLTOOL_API,MgmtData,XMLObject);
51 DECL_XMLOBJECT_CONTENT(Data);
55 * XMLObject representing XML Digital Signature, version 20020212, Modulus element.
57 BEGIN_XMLOBJECT(XMLTOOL_API,Modulus,XMLObject);
58 DECL_XMLOBJECT_CONTENT(Value);
62 * XMLObject representing XML Digital Signature, version 20020212, Exponent element.
64 BEGIN_XMLOBJECT(XMLTOOL_API,Exponent,XMLObject);
65 DECL_XMLOBJECT_CONTENT(Value);
69 * XMLObject representing XML Digital Signature, version 20020212, RSAKeyValue element.
71 BEGIN_XMLOBJECT(XMLTOOL_API,RSAKeyValue,XMLObject);
72 DECL_XMLOBJECT_CHILD(Modulus);
73 DECL_XMLOBJECT_CHILD(Exponent);
74 /** RSAKeyValueType local name */
75 static const XMLCh TYPE_NAME[];
79 * XMLObject representing XML Digital Signature, version 20020212, KeyInfo element.
81 BEGIN_XMLOBJECT(XMLTOOL_API,KeyInfo,ElementProxy);
82 DECL_XMLOBJECT_ATTRIB(Id,ID);
83 DECL_XMLOBJECT_CHILDREN(KeyName);
84 DECL_XMLOBJECT_CHILDREN(MgmtData);
85 /** KeyInfoType local name */
86 static const XMLCh TYPE_NAME[];
89 DECL_XMLSIGOBJECTBUILDER(KeyName);
90 DECL_XMLSIGOBJECTBUILDER(MgmtData);
91 DECL_XMLSIGOBJECTBUILDER(Modulus);
92 DECL_XMLSIGOBJECTBUILDER(Exponent);
93 DECL_XMLSIGOBJECTBUILDER(RSAKeyValue);
94 DECL_XMLSIGOBJECTBUILDER(KeyInfo);
96 BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,KeyName);
97 XMLOBJECTVALIDATOR_REQUIRE(KeyName,Name);
98 END_XMLOBJECTVALIDATOR;
100 BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,MgmtData);
101 XMLOBJECTVALIDATOR_REQUIRE(MgmtData,Data);
102 END_XMLOBJECTVALIDATOR;
104 BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,Modulus);
105 XMLOBJECTVALIDATOR_REQUIRE(Modulus,Value);
106 END_XMLOBJECTVALIDATOR;
108 BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,Exponent);
109 XMLOBJECTVALIDATOR_REQUIRE(Exponent,Value);
110 END_XMLOBJECTVALIDATOR;
112 BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,RSAKeyValue);
113 XMLOBJECTVALIDATOR_REQUIRE(RSAKeyValue,Modulus);
114 XMLOBJECTVALIDATOR_REQUIRE(RSAKeyValue,Exponent);
115 END_XMLOBJECTVALIDATOR;
117 BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,KeyInfo);
118 XMLOBJECTVALIDATOR_CHECKEMPTY(KeyInfo,XMLObject);
119 END_XMLOBJECTVALIDATOR;
123 #endif /* __xmltooling_keyinfo_h__ */