Main Page | Modules | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

XSECProvider.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2002-2004 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * imitations under the License.
00015  */
00016 
00017 /*
00018  * XSEC
00019  *
00020  * XSECProvider.hpp := Main interface class that applications use to
00021  *                     get access to Signature and Encryption functions.
00022  *
00023  * $Id: XSECProvider.hpp,v 1.12 2004/02/28 22:17:19 blautenb Exp $
00024  *
00025  */
00026 #ifndef XSECPROVIDER_INCLUDE
00027 #define XSECPROVIDER_INCLUDE
00028 
00029 #include <xsec/utils/XSECPlatformUtils.hpp>
00030 #include <xsec/dsig/DSIGSignature.hpp>
00031 #include <xsec/xenc/XENCCipher.hpp>
00032 
00033 #include <xercesc/util/Mutexes.hpp>
00034 
00035 #include <vector>
00036 
00054 class DSIG_EXPORT XSECProvider {
00055 
00056 #if defined(XALAN_NO_NAMESPACES)
00057     typedef vector<DSIGSignature *>         SignatureListVectorType;
00058 #else
00059     typedef std::vector<DSIGSignature *>    SignatureListVectorType;
00060 #endif
00061 
00062 #if defined(XALAN_NO_NAMESPACES)
00063     typedef vector<XENCCipher *>            CipherListVectorType;
00064 #else
00065     typedef std::vector<XENCCipher *>       CipherListVectorType;
00066 #endif
00067 
00068 public:
00069 
00072     
00081     XSECProvider();
00082     ~XSECProvider();
00083 
00085 
00088     
00106     DSIGSignature * newSignatureFromDOM(
00107         XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, 
00108         XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *sigNode
00109     );
00110 
00127     DSIGSignature * newSignatureFromDOM(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc);
00128 
00139     DSIGSignature * newSignature(void);
00140 
00160     void releaseSignature(DSIGSignature * toRelease);
00161 
00163 
00166 
00179     XENCCipher * newCipher(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc);
00180 
00193     void releaseCipher(XENCCipher * toRelease);
00194 
00196 
00199 
00212     void setDefaultURIResolver(XSECURIResolver * resolver);
00213 
00215 
00216 private:
00217 
00218     // Copy constructor is disabled
00219     XSECProvider(const XSECProvider &);
00220     XSECProvider * operator = (const XSECProvider &);
00221 
00222     // Internal functions
00223 
00224     void setup(DSIGSignature *sig);
00225     void setup(XENCCipher *cipher);
00226 
00227     SignatureListVectorType                     m_activeSignatures;
00228     CipherListVectorType                        m_activeCiphers;
00229     XSECURIResolver                             * mp_URIResolver;
00230     XERCES_CPP_NAMESPACE_QUALIFIER XMLMutex     m_providerMutex;
00231 };
00232 
00235 #endif /* XSECPROVIDER_INCLUDE */

Generated on Sun Mar 14 21:35:34 2004 for XML-Security-C by doxygen 1.3.2