00001 /* 00002 * 00003 * Copyright (C) 1998-2010, OFFIS e.V. 00004 * All rights reserved. See COPYRIGHT file for details. 00005 * 00006 * This software and supporting documentation were developed by 00007 * 00008 * OFFIS e.V. 00009 * R&D Division Health 00010 * Escherweg 2 00011 * D-26121 Oldenburg, Germany 00012 * 00013 * 00014 * Module: dcmsign 00015 * 00016 * Author: Norbert Loxen 00017 * 00018 * Purpose: 00019 * classes: SiCertificate 00020 * 00021 * Last Update: $Author: joergr $ 00022 * Update Date: $Date: 2010-10-14 13:17:24 $ 00023 * CVS/RCS Revision: $Revision: 1.8 $ 00024 * Status: $State: Exp $ 00025 * 00026 * CVS/RCS Log at end of file 00027 * 00028 */ 00029 00030 #ifndef SICERT_H 00031 #define SICERT_H 00032 00033 #include "dcmtk/config/osconfig.h" 00034 #include "dcmtk/dcmsign/sitypes.h" 00035 00036 #ifdef WITH_OPENSSL 00037 00038 #include "dcmtk/ofstd/ofstring.h" /* for class OFString */ 00039 00040 class DcmItem; 00041 class SiAlgorithm; 00042 struct x509_st; 00043 typedef struct x509_st X509; 00044 00047 class SiCertificate 00048 { 00049 public: 00050 00052 SiCertificate(); 00053 00055 virtual ~SiCertificate(); 00056 00062 OFCondition loadCertificate(const char *filename, int filetype); 00063 00069 OFCondition read(DcmItem& item); 00070 00076 OFCondition write(DcmItem& item); 00077 00080 E_KeyType getKeyType(); 00081 00087 SiAlgorithm *createAlgorithmForPublicKey(); 00088 00093 long getX509Version(); 00094 00099 void getCertSubjectName(OFString& str); 00100 00105 void getCertIssuerName(OFString& str); 00106 00111 long getCertSerialNo(); 00112 00117 void getCertValidityNotBefore(OFString& str); 00118 00123 void getCertValidityNotAfter(OFString& str); 00124 00130 long getCertKeyBits(); 00131 00135 X509 *getRawCertificate(); 00136 00137 private: 00138 00140 SiCertificate(SiCertificate& arg); 00141 00143 SiCertificate& operator=(SiCertificate& arg); 00144 00146 X509* x509; 00147 00148 }; 00149 00150 #endif 00151 #endif 00152 00153 /* 00154 * $Log: sicert.h,v $ 00155 * Revision 1.8 2010-10-14 13:17:24 joergr 00156 * Updated copyright header. Added reference to COPYRIGHT file. 00157 * 00158 * Revision 1.7 2010-02-22 11:39:54 uli 00159 * Remove some unneeded includes. 00160 * 00161 * Revision 1.6 2005-12-08 16:04:33 meichel 00162 * Changed include path schema for all DCMTK header files 00163 * 00164 * Revision 1.5 2003/07/04 13:28:13 meichel 00165 * Replaced forward declarations for OFString with explicit includes, 00166 * needed when compiling with HAVE_STD_STRING 00167 * 00168 * Revision 1.4 2003/06/04 14:21:03 meichel 00169 * Simplified include structure to avoid preprocessor limitation 00170 * (max 32 #if levels) on MSVC5 with STL. 00171 * 00172 * Revision 1.3 2001/09/26 14:30:19 meichel 00173 * Adapted dcmsign to class OFCondition 00174 * 00175 * Revision 1.2 2001/06/01 15:50:47 meichel 00176 * Updated copyright header 00177 * 00178 * Revision 1.1 2000/11/07 16:48:53 meichel 00179 * Initial release of dcmsign module for DICOM Digital Signatures 00180 * 00181 * 00182 */ 00183