limal-ca-mgm
DNObject.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:       DNObject.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_DN_OBJECT_HPP
00023 #define    LIMAL_CA_MGM_DN_OBJECT_HPP
00024 
00025 #include  <limal/ca-mgm/config.h>
00026 #include  <limal/ca-mgm/CommonData.hpp>
00027 #include  <blocxx/COWIntrusiveReference.hpp>
00028 
00029 namespace LIMAL_NAMESPACE {
00030 
00031 namespace CA_MGM_NAMESPACE {
00032 
00033         class CAConfig;
00034         class RDNObjectImpl;
00035         class DNObjectImpl;
00036         
00037         class RDNObject {
00038         public:
00039                 RDNObject();
00040                 RDNObject(const RDNObject& rdn);
00041                 virtual ~RDNObject();
00042 
00043 #ifndef SWIG
00044                 
00045                 RDNObject& operator=(const RDNObject& rdn);
00046 
00047 #endif
00048                 void   setRDNValue(const String& value);
00049 
00050                 String getType() const;
00051                 String getValue() const;
00052 
00053                 String getOpenSSLValue() const;
00054 
00055                 virtual bool                 valid() const;
00056                 virtual blocxx::StringArray  verify() const;
00057 
00058                 virtual blocxx::StringArray  dump() const;
00059 
00060 #ifndef SWIG
00061 
00062                 friend bool operator==(const RDNObject &l, const RDNObject &r);
00063                 friend bool operator<(const RDNObject &l, const RDNObject &r);
00064 
00065 #endif
00066                 
00067         protected:
00068                 blocxx::COWIntrusiveReference<RDNObjectImpl> m_impl;
00069         
00070         };
00071 
00072         class DNObject {
00073         public:
00074                 DNObject();
00075                 DNObject(CAConfig* caConfig, Type type);
00076                 DNObject(const blocxx::List<RDNObject> &dn);
00077                 DNObject(const DNObject& dn);
00078                 virtual ~DNObject();
00079 
00080 #ifndef SWIG
00081 
00082                 DNObject& operator=(const DNObject& dn);
00083 
00084 #endif
00085                 
00086                 void                         setDN(const blocxx::List<RDNObject> &dn);
00087                 blocxx::List<RDNObject>      getDN() const;
00088 
00089                 String                       getOpenSSLString() const;
00090 
00091                 virtual bool                 valid() const;
00092                 virtual blocxx::StringArray  verify() const;
00093         
00094                 virtual blocxx::StringArray  dump() const;
00095 
00096         protected:
00097                 blocxx::COWIntrusiveReference<DNObjectImpl> m_impl;
00098         
00099         private:
00100                 blocxx::StringArray
00101                 checkRDNList(const blocxx::List<RDNObject>& list) const;
00102         };
00103 
00104 }
00105 }
00106 
00107 #endif // LIMAL_CA_MGM_DN_OBJECT_HPP