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

XSECCryptoException.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2002-2005 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  * limitations under the License.
00015  */
00016 
00017 /*
00018  * XSEC
00019  *
00020  * XSECCryptoException:= How we throw exceptions in XSEC
00021  *
00022  * Author(s): Berin Lautenbach
00023  *
00024  * $Id: XSECCryptoException.hpp,v 1.11 2005/02/03 12:48:16 milan Exp $
00025  *
00026  */
00027 #ifndef XSECCRYPTOEXCEPTION_INCLUDE
00028 #define XSECCRYPTOEXCEPTION_INCLUDE
00029 
00030 #include <xsec/utils/XSECSafeBuffer.hpp>
00031 
00032 #include <stdlib.h>
00033 
00046 extern const char * XSECCryptoExceptionStrings[];
00047 
00064 class DSIG_EXPORT XSECCryptoException {
00065 
00066 public:
00067 
00078     enum XSECCryptoExceptionType {
00079 
00080         None                        = 0,
00081         GeneralError                = 1,
00082         MDError                     = 2,        // Error in Message Digest
00083         Base64Error                 = 3,        // Error in a Base64 operation
00084         MemoryError                 = 4,        // Memory allocation error
00085         X509Error                   = 5,        // X509 problem
00086         DSAError                    = 6,        // DSA Error
00087         RSAError                    = 7,        // RSA Error
00088         SymmetricError              = 8,
00089         UnsupportedError            = 9,        // Called function is not supported
00090         UnsupportedAlgorithm        = 10,
00091         UnknownError                = 11        // Must be last!
00092 
00093     };
00094 
00095     
00096 public:
00097 
00100 
00113     XSECCryptoException(XSECCryptoExceptionType eNum, const char * inMsg = NULL);
00114 
00124     XSECCryptoException(XSECCryptoExceptionType eNum, safeBuffer &inMsg);
00125 
00132     XSECCryptoException(const XSECCryptoException &toCopy);
00133     ~XSECCryptoException();
00134 
00136 
00139 
00148     const char * getMsg(void);
00149 
00157 
00158     XSECCryptoExceptionType getType(void);
00159 
00160 private:
00161 
00162     char                * msg;              // Message to the caller
00163     XSECCryptoExceptionType type;               // Type of exception
00164     XSECCryptoException();
00165 
00166 };
00167 
00168 
00169 #endif /* XSECCryptoEXCEPTION_HEADER */

Generated on Sun Jul 3 17:37:28 2005 for XML-Security-C by  doxygen 1.4.2