limal-ca-mgm
CommonData.hpp
Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                                                                      |
00003 |                     _     _   _   _     __     _                     |
00004 |                    | |   | | | \_/ |   /  \   | |                    |
00005 |                    | |   | | | |_| |  / /\ \  | |                    |
00006 |                    | |__ | | | | | | / ____ \ | |__                  |
00007 |                    |____||_| |_| |_|/ /    \ \|____|                 |
00008 |                                                                      |
00009 |                             ca-mgm library                           |
00010 |                                                                      |
00011 |                                         (C) SUSE Linux Products GmbH |
00012 \----------------------------------------------------------------------/
00013 
00014   File:       CommonData.hpp
00015 
00016   Author:     <Michael Calmer>     <mc@suse.de>
00017   Maintainer: <Michael Calmer>     <mc@suse.de>
00018 
00019   Purpose:
00020 
00021 /-*/
00022 #ifndef    LIMAL_CA_MGM_COMMON_DATA_HPP
00023 #define    LIMAL_CA_MGM_COMMON_DATA_HPP
00024 
00025 #include  <blocxx/Types.hpp>
00026 #include  <blocxx/String.hpp>
00027 #include  <blocxx/List.hpp>
00028 #include  <blocxx/Array.hpp>
00029 #include  <blocxx/Map.hpp>
00030 #include  <errno.h>
00031 
00032 #define   REPOSITORY   "/var/lib/CAM/"
00033 
00034 namespace LIMAL_NAMESPACE {
00035 
00036 namespace CA_MGM_NAMESPACE {
00037 
00038     typedef blocxx::String       String;
00039     typedef blocxx::List<String> StringList;
00040     
00041     enum Type {
00042         E_Client_Req,  
00043         E_Server_Req,  
00044         E_CA_Req,      
00045         E_Client_Cert, 
00046         E_Server_Cert, 
00047         E_CA_Cert,     
00048         E_CRL          
00049     };
00050 
00051     enum FormatType {
00052         E_PEM,
00053         E_DER
00054     };
00055 
00056     enum KeyAlg {
00057         E_RSA,
00058         E_DSA,
00059         E_DH
00060     };
00061 
00062     enum SigAlg {
00063         E_SHA1RSA,
00064         E_MD5RSA,
00065         E_SHA1DSA,
00066     };
00067 
00068     enum MD {
00069         E_SHA1,
00070         E_MD5,
00071         E_MDC2,
00072     };
00073         
00074         enum EErrorCodes
00075         {
00076                 E_GENERIC  = blocxx::Exception::UNKNOWN_ERROR_CODE,  // == -1
00077                 E_C_EMPTY  = -100, // value empty
00078                 E_ST_EMPTY = -101,
00079                 E_L_EMPTY  = -102,
00080                 E_O_EMPTY  = -103,
00081                 E_OU_EMPTY = -104,
00082                 E_CN_EMPTY = -105,
00083                 E_EM_EMPTY = -106,
00084                 E_C_NF     = -110, // value not found
00085                 E_ST_NF    = -111,
00086                 E_L_NF     = -112,
00087                 E_O_NF     = -113,
00088                 E_OU_NF    = -114,
00089                 E_CN_NF    = -115,
00090                 E_EM_NF    = -116,
00091                 E_C_NM     = -120, // (no match) value does not match CA
00092                 E_ST_NM    = -121,
00093                 E_L_NM     = -122,
00094                 E_O_NM     = -123,
00095                 E_OU_NM    = -124,
00096                 E_CN_NM    = -125,
00097                 E_EM_NM    = -126,
00098                 E_INVALID_PASSWD = -200,   // invalid password
00099                 E_FILE_NOT_FOUND = ENOENT, //errno
00100                 E_FILE_EXISTS    = EEXIST  //errno
00101         };
00102 }
00103 }
00104 
00105 #endif   // LIMAL_CA_MGM_COMMON_DATA_HPP