1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 /*
21  * XSEC
22  *
23  * DSIGTransformBase64 := Class that holds Base 64 Transform information
24  *
25  * $Id: DSIGTransformBase64.hpp 1817973 2017-12-13 03:18:57Z scantor $
26  *
27  */
28 
29 // XSEC Includes
30 
31 #include <xsec/dsig/DSIGTransform.hpp>
32 
33 /**
34  * @ingroup pubsig
35  */
36 
37 /**
38  * @brief Transform holder for Base 64.
39  *
40  * The DSIGTransformbase64 class is used to hold base64 \<Transform\> elements
41  * within a document.
42  *
43  * This is a very simple transform with no real options.
44  *
45  * @see TXFMBase
46  * @see DSIGTransform
47  *
48  */
49 
50 
51 
52 class XSEC_EXPORT DSIGTransformBase64 : public DSIGTransform {
53 
54 public:
55 
56 	/** @name Constructors and Destructors */
57     //@{
58 
59     /**
60 	 * \brief Contructor used for existing XML signatures.
61 	 *
62 	 * The Node structure already exists, so read the nodes in.
63 	 *
64 	 * @param env The operating environment
65 	 * @param node The DOM node (within doc) that is to be used as the base of the Transform.
66 	 * @see #load
67 	 */
68 
69 	DSIGTransformBase64(const XSECEnv * env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node);
70 
71     /**
72 	 * \brief Contructor used for new signatures.
73 	 *
74 	 * The Node structure will have to be created.
75 	 *
76 	 * @note DSIGTransform structures should only ever be created via calls to a
77 	 * DSIGTransformList object.
78 	 *
79 	 * @param env The operating environment
80 	 * @see createBlankTransform
81 	 */
82 
83 	DSIGTransformBase64(const XSECEnv * env);
84 
85 	/**
86 	 * \brief Destructor.
87 	 *
88 	 * Destroy the DSIGSignature elements.
89 	 *
90 	 * Does not destroy any associated DOM Nodes
91 	 */
92 
93 	virtual ~DSIGTransformBase64();
94 
95 	//@}
96 
97 	/** @name Interface Methods */
98 
99 	//@{
100 
101 	/**
102 	 * \brief Create the Base 64transformer element.
103 	 *
104 	 * Implemented by each Transform class and used by the DSIGSignature
105 	 * to construct a complete Transform list.
106 	 */
107 
108 	virtual void appendTransformer(TXFMChain * input);
109 
110 	/**
111 	 * \brief Construct blank Base64 Transform element.
112 	 *
113 	 * Instruct the implementation to create the required
114 	 * transform and return the newly constructed DOMNode structure
115 	 */
116 
117 	virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *
118 		createBlankTransform(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * parentDoc);
119 
120 	/**
121 	 * \brief Load a DOM structure
122 	 *
123 	 * For a Base64 transform this does almost nothing.
124 	 *
125 	 */
126 
127 	virtual void load(void);
128 
129 	//@}
130 
131 
132 private:
133 
134 	DSIGTransformBase64();
135 	DSIGTransformBase64(const DSIGTransformBase64 & theOther);
136 
137 };
138