00001 /* 00002 * 00003 * Copyright (C) 1998-2005, OFFIS 00004 * 00005 * This software and supporting documentation were developed by 00006 * 00007 * Kuratorium OFFIS e.V. 00008 * Healthcare Information and Communication Systems 00009 * Escherweg 2 00010 * D-26121 Oldenburg, Germany 00011 * 00012 * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY 00013 * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 00014 * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR 00015 * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND 00016 * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. 00017 * 00018 * Module: dcmsign 00019 * 00020 * Author: Norbert Loxen 00021 * 00022 * Purpose: 00023 * classes: SiCertificate 00024 * 00025 * Last Update: $Author: meichel $ 00026 * Update Date: $Date: 2005/12/08 16:04:33 $ 00027 * CVS/RCS Revision: $Revision: 1.6 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 #ifndef SICERT_H 00035 #define SICERT_H 00036 00037 #include "dcmtk/config/osconfig.h" 00038 #include "dcmtk/dcmsign/sitypes.h" 00039 00040 #ifdef WITH_OPENSSL 00041 00042 #include "dcmtk/dcmdata/dcerror.h" 00043 #include "dcmtk/ofstd/ofstring.h" /* for class OFString */ 00044 00045 class DcmItem; 00046 class SiAlgorithm; 00047 struct x509_st; 00048 typedef struct x509_st X509; 00049 00052 class SiCertificate 00053 { 00054 public: 00055 00057 SiCertificate(); 00058 00060 virtual ~SiCertificate(); 00061 00067 OFCondition loadCertificate(const char *filename, int filetype); 00068 00074 OFCondition read(DcmItem& item); 00075 00081 OFCondition write(DcmItem& item); 00082 00085 E_KeyType getKeyType(); 00086 00092 SiAlgorithm *createAlgorithmForPublicKey(); 00093 00098 long getX509Version(); 00099 00104 void getCertSubjectName(OFString& str); 00105 00110 void getCertIssuerName(OFString& str); 00111 00116 long getCertSerialNo(); 00117 00122 void getCertValidityNotBefore(OFString& str); 00123 00128 void getCertValidityNotAfter(OFString& str); 00129 00135 long getCertKeyBits(); 00136 00140 X509 *getRawCertificate(); 00141 00142 private: 00143 00145 SiCertificate(SiCertificate& arg); 00146 00148 SiCertificate& operator=(SiCertificate& arg); 00149 00151 X509* x509; 00152 00153 }; 00154 00155 #endif 00156 #endif 00157 00158 /* 00159 * $Log: sicert.h,v $ 00160 * Revision 1.6 2005/12/08 16:04:33 meichel 00161 * Changed include path schema for all DCMTK header files 00162 * 00163 * Revision 1.5 2003/07/04 13:28:13 meichel 00164 * Replaced forward declarations for OFString with explicit includes, 00165 * needed when compiling with HAVE_STD_STRING 00166 * 00167 * Revision 1.4 2003/06/04 14:21:03 meichel 00168 * Simplified include structure to avoid preprocessor limitation 00169 * (max 32 #if levels) on MSVC5 with STL. 00170 * 00171 * Revision 1.3 2001/09/26 14:30:19 meichel 00172 * Adapted dcmsign to class OFCondition 00173 * 00174 * Revision 1.2 2001/06/01 15:50:47 meichel 00175 * Updated copyright header 00176 * 00177 * Revision 1.1 2000/11/07 16:48:53 meichel 00178 * Initial release of dcmsign module for DICOM Digital Signatures 00179 * 00180 * 00181 */ 00182