CPPXT-104 - Add exception handling to integer conversions
[shibboleth/cpp-xmltooling.git] / xmltooling / encryption / Encryption.h
index ab1b57c..33c5e12 100644 (file)
@@ -1,17 +1,21 @@
-/*
- *  Copyright 2001-2006 Internet2
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the University Corporation for Advanced Internet
+ * Development, Inc. (UCAID) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
+ *
+ * UCAID licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the
+ * License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
  */
 
 /**
  * XMLObjects representing XML Encryption content
  */
 
-#ifndef __xmltooling_encryption_h__
+#if !defined(__xmltooling_encryption_h__) && !defined(XMLTOOLING_NO_XMLSEC)
 #define __xmltooling_encryption_h__
 
-#include <xmltooling/signature/KeyInfo.h>
+#include <xmltooling/ConcreteXMLObjectBuilder.h>
+#include <xmltooling/ElementProxy.h>
+#include <xmltooling/util/XMLConstants.h>
 
+#include <cstdio>
+#include <boost/lexical_cast.hpp>
+
+namespace xmlsignature {
+    class XMLTOOL_API KeyInfo;
+    class XMLTOOL_API Transform;
+};
+
+/**
+ * Macro for declaring encryption builders.
+ * 
+ * @param cname name of class being built
+ */
 #define DECL_XMLENCOBJECTBUILDER(cname) \
     DECL_XMLOBJECTBUILDER(XMLTOOL_API,cname,xmlconstants::XMLENC_NS,xmlconstants::XMLENC_PREFIX)
 
 /**
+ * Macro for declaring encryption 1.1 builders.
+ * 
+ * @param cname name of class being built
+ */
+#define DECL_XMLENC11OBJECTBUILDER(cname) \
+    DECL_XMLOBJECTBUILDER(XMLTOOL_API,cname,xmlconstants::XMLENC11_NS,xmlconstants::XMLENC11_PREFIX)
+
+/**
  * @namespace xmlencryption
  * Namespace for XML Encryption schema objects
  */
@@ -127,6 +154,12 @@ namespace xmlencryption {
         static const XMLCh TYPE_NAME[];
     END_XMLOBJECT;
 
+    BEGIN_XMLOBJECT(XMLTOOL_API,MGF,xmltooling::XMLObject,XML Encryption 1.1 MGF element);
+        DECL_STRING_ATTRIB(Algorithm,ALGORITHM);
+        /** MGFType local name */
+        static const XMLCh TYPE_NAME[];
+    END_XMLOBJECT;
+
     DECL_XMLENCOBJECTBUILDER(CarriedKeyName);
     DECL_XMLENCOBJECTBUILDER(CipherData);
     DECL_XMLENCOBJECTBUILDER(CipherReference);
@@ -143,6 +176,8 @@ namespace xmlencryption {
     DECL_XMLENCOBJECTBUILDER(ReferenceList);
     DECL_XMLENCOBJECTBUILDER(Transforms);
 
+    DECL_XMLENC11OBJECTBUILDER(MGF);
+
     /**
      * Registers builders and validators for XML Encryption classes into the runtime.
      */